filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
1156.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldGetUser
{
Get-WmiObject Win32_UserAccount -Filter "Domain='$($env:ComputerName)'" | ForEach-Object {
$user = Get-WmiLocalUserAccount -Username $_.Name
... | 0 |
sample_53_31.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... | 0 |
2172.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$false, HelpMessa... | 0 |
sample_47_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Integration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Integration.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEdition... | 0 |
sample_1_22.ps1 | // Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_SystemPSDevice
// ==================================================================
[dynamic, provider("dcismprovider"),
Association, Description(
"DC... | 0 |
Set-ToStringMethod.ps1 | function Set-ToStringMethod {
<#
.Synopsis
Overwrites default .ToString() method of a given type.
.Description
Some commands use .ToString() method of an object to produce output.
Default (inherited from System.Object) result of that method is object's type FullName.
Tha... | 0 |
sample_5_29.ps1 | #************************************************
# TS_RegistrySizeLimitCheck.ps1
# Version 1.0
# Date: 12-21-2011
# Author: v-anecho
# Description: The RegistrySizeLimit entry exists in the registry. This may cause the computer to stop responding as well as log Event ID 333's in the System Event Log.
#**********... | 0 |
576.ps1 |
function Set-SPOListPermissions
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$groupname,
[Parameter(Mandatory=$true, Position=2)]
[string]$listname,
[Parameter(Mandatory=$true, Position=3)]
[string]$roleType
)
process
{
Write-Host "Creating permissions for list ... | 0 |
1571.ps1 | function Get-MrAutoService {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[string[]]$ComputerName,
[System.Management.Automation.Credential()]$Credential = [System.Mana... | 0 |
1847.ps1 |
$cmdletName = "Get-Counter"
. "$PSScriptRoot/CounterTestHelperFunctions.ps1"
$badName = "bad-name-DAD288C0-72F8-47D3-8C54-C69481B528DF"
$counterPaths = @{
MemoryBytes = TranslateCounterPath "\Memory\Available Bytes"
TotalDiskRead = TranslateCounterPath "\PhysicalDisk(_Total)\Disk Read Bytes/sec"
Unkno... | 0 |
Get-OLEDBData_2.ps1 | ###########################################################################
# Get-OLEDBData
# --------------------------------------------
# Description: This function is used to retrieve data via an OLEDB data
# connection.
#
# Inputs: $connectstring - Connection String.
# $sql ... | 0 |
sample_11_1.ps1 | #************************************************
# TS_2628581_HPUPDUpgrade.ps1
# Version 1.0.1
# TemplateVersion 1.2
# Date: 04/17/2012 08:02:35
# Author: jasonf
# Description: Checks the registry for an HP UPD upgrade from 5.2 to 5.3 which is known to cause issues
#********************************************... | 0 |
sample_53_85.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... | 0 |
2717.ps1 |
foreach($userpath in (Get-WmiObject win32_userprofile | Select-Object -ExpandProperty localpath)) {
if (Test-Path(($userpath + "\AppData\Local\Temp\"))) {
Get-ChildItem -Force ($userpath + "\AppData\Local\Temp\*") | Select-Object FullName, CreationTimeUtc, LastAccessTimeUtc, LastWriteTimeUtc
}
} | 0 |
sample_53_40.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Import-EditorCommand {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[OutputType([Microsoft.PowerShell.EditorServices.Extensions.EditorCommand, Microsoft.PowerShell.EditorServices])]
[Cmdle... | 0 |
1276.ps1 |
function Get-CServiceConfiguration
{
[CmdletBinding()]
[OutputType([Carbon.Service.ServiceInfo])]
param(
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0)]
[string]
$Name,
[Parameter(ValueFromPipelineByPropertyName=$true)]
[A... | 0 |
sample_49_3.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=استكشاف الأخطاء وإصلاحها
Troubleshoot_DetectDVDDevice=يتم الآن التحقق من جهاز DVD ...
Troubleshoot_DetectDVDvideoDecoder=يتم الآن التحقق من أداة فك ترميز الفيديو لتشغيل قرص DVD ...
T... | 0 |
sample_25_63.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Remove-ServiceFabric... | 0 |
4254.ps1 | $psver = $PSVersionTable.psversion.Major
if ($psver -eq '2') {
Write-Output "Powershell version 3 required"
}
function New-ZipFile {
[CmdletBinding()]
param(
[Parameter(Position=0, Mandatory=$true)]
$ZipFilePath,
[Parameter(Position=1, Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[... | 0 |
GetSet-Users.ps1 | param(
[Parameter(Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
[alias("Name","ComputerName")][string[]] $Computers = @($env:computername),
#works automagically for domain members or local computer,
#must be set manual for workgroups or forests
[string] $NTDomain = ($env:UserDomain),
... | 0 |
sample_45_36.ps1 | #
# Module manifest for module 'OCI.PSModules.Devops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Devops.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compatib... | 0 |
sample_65_86.ps1 | #
# Module manifest for module 'OCI.PSModules.Globallydistributeddatabase'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll'
# Version number of this module.
ModuleVersion =... | 0 |
Get-Parameter_9.ps1 | function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) {
$command = Get-Command $Cmdlet -ea silentlycontinue
# resolve aliases (an alias can point to another alias)
while ($command.CommandType -eq "Alias") {
$command = Get-Command ($command.definition)
}
if (-not $command) { return }... | 0 |
4416.ps1 | function Update-Module {
[CmdletBinding(SupportsShouldProcess = $true,
HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=398576')]
Param
(
[Parameter(ValueFromPipelineByPropertyName = $true,
Position = 0)]
[ValidateNotNullOrEmpty()]
[String[]]
$Name,... | 0 |
2832.ps1 | $global:psakeSwitches = @('-docs', '-task', '-properties', '-parameters')
function script:psakeSwitches($filter) {
$psakeSwitches | Where-Object { $_ -like "$filter*" }
}
function script:psakeDocs($filter, $file) {
if ($file -eq $null -or $file -eq '') { $file = 'psakefile.ps1' }
psake $file -docs | out-strin... | 0 |
sample_22_15.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... | 0 |
sample_41_32.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 0 |
4482.ps1 |
configuration PSModule_InstallModuleAllowClobberConfig
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$ModuleName
)
Import-DscResource -ModuleName ... | 0 |
sample_36_89.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... | 0 |
Get-WebFile 3.7.3.ps1 | ## Get-WebFile (aka wget for PowerShell)
##############################################################################################################
## Downloads a file or page from the web
## History:
## v3.7.3 - Checks to see if URL is formatted properly (contains http or https)
## v3.7.2 - Puts a try-catch b... | 0 |
Write-Twilight.ps1 | #Write-Twilight
while(1){
$wc = Get-Random -Minimum (Get-Random -Minimum 1 -Maximum 3) -Maximum (Get-Random -Minimum 4 -Maximum 14)
for($y=0; $y-lt$wc; $y++){
$word = ""
$max = Get-Random -Minimum 5 -Maximum 11
$wl = Get-Random -Minimum 1 -Maximum $max
fo... | 0 |
sample_12_50.ps1 | <RunRuleResults><Header reportDate="18.12.2023." reportTime="13:42" savedToDirectory="C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20231218_134246\SystemConfigurationCheck_Report.htm"><Machines><Machine value="ALT-SAMPLER-WIN" /></Machines></Header><group groupName="GlobalRules" groupDescription="SQL S... | 0 |
4148.ps1 |
[CmdletBinding()]
param ()
function Uninstall-MSIbyGUID {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][String]$GUID,
[ValidateNotNullOrEmpty()][String]$Switches
)
[string]$DisplayName = ((Get-ChildItem -Path REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserDa... | 0 |
disabled AD accounts_1.ps1 | #Get Domain List
$objForest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$DomainList = @($objForest.Domains | Select-Object Name)
$Domains = $DomainList | foreach {$_.Name}
#get users list
$users = Get-Content U:\\EMCU15FI3_USER.txt
$total = $users.count
"SAMaccountname;DisplayName... | 0 |
3545.ps1 |
function Test-AzureVMProtectionCheck
{
$location = Get-ResourceGroupLocation
$resourceGroupName = Create-ResourceGroup $location
try
{
$vm = Create-GalleryVM $resourceGroupName $location
$status = Get-AzRecoveryServicesBackupStatus `
-Name $vm.Name `
-ResourceGroupName $vm.ResourceGroup... | 0 |
688.ps1 |
function Register-RsPowerBI
{
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param
(
[Parameter(Mandatory = $True)]
[string]
$ClientId,
[Parameter(Mandatory = $True)]
[string]
$ClientSecret,
[Parameter(Mand... | 0 |
sample_8_49.ps1 | #************************************************
# DC_ClusterDependencyReport.ps1
# Version 1.0.1
# Date: 07-23-2009
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script is used to obtain cluster resource dependency report
#************************************************
Import-Localize... | 0 |
sample_7_22.ps1 | # Load Common Library
# Load Reporting Utilities
#_#$debug = $false
. ./utils_cts.ps1
. ./TS_RemoteSetup.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.S... | 0 |
sample_20_95.ps1 | #
# Module manifest for module 'Microsoft.SME.PacketMon'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.PacketMon.psm1'
# Version number of this module.
ModuleVersion = '4.10.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to un... | 0 |
Prompt Replacement.ps1 | function prompt {
$mapped_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=4" | foreach {echo $_.deviceid}
$local_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=3" | foreach {echo $_.deviceid}
$removable_drives = Get-WmiObject Win32_LogicalDisk -Filter "drivetype=2" | foreach {ec... | 0 |
sample_29_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
sample_66_85.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... | 0 |
SharePoint Site Owners.ps1 | Get-SPWebApplication | Get-SPSite -Limit ALL |
ForEach-Object {
$content = "";
$rootSite = New-Object Microsoft.SharePoint.SPSite($_.Url)
$subSites = $rootSite.AllWebs;
if($subSites.Count -le 0)
{
@@ This occurs when a Site Collection does not contains any subsite (not even the root s... | 0 |
Import-Methods_1.ps1 | # [CmdletBinding()]
param(
#[Parameter(Position=1,ValueFromPipeline=$true)]
[type]$type
,
#[Parameter()]
#[Alias("Properties")]
[switch]$IncludeProperties
)
BEGIN {
function MakeFunction() {
PROCESS {
$func = "function:global:$($_.name)"
if (test-path $func) { remove-item ... | 0 |
sample_17_81.ps1 | $ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
Set-Variable -Option Constant -Name CameraPnPClassName -Value "Camera"
Set-Variable -Option Constant -Name ImagePnPClassName -Value "Image"
Set-Variable -Option Constant -Name DeviceParametersKeyName -Value "Device Para... | 0 |
Get-DiskSizeInfo.ps1 | Function Get-DiskSizeInfo {
<#
.DESCRIPTION
Check the Disk(s) Size and remaining freespace.
.PARAMETER ComputerName
Specify the computername(s)
.INPUTS
System.String
.OUTPUTS
System.Management.Automation.PSObject
.EXAMPLE
... | 0 |
766.ps1 |
$fields = @(
New-Object "System.Management.Automation.Host.FieldDescription" "Input"
New-Object "System.Management.Automation.Host.FieldDescription" "Input List"
)
$fields[1].SetParameterType([int[]])
$host.UI.Prompt("Caption", "Message", $fields)
Get-Credential
Get-Credential -Message "Test!"
Get-Credentia... | 0 |
Get-Parameter_17.ps1 | param (
$Cmdlet,
[switch]$ShowCommon,
[switch]$Full
)
$command = Get-Command $Cmdlet -ea silentlycontinue
# resolve aliases (an alias can point to another alias)
while ($command.CommandType -eq "Alias") {
$command = Get-Command ($command.definition)
}
if (-not $command) { return }
foreach ($p... | 0 |
sample_16_60.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function ConvertTo-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.IScriptExtent])]
param(
[Parameter(... | 0 |
sample_39_59.ps1 | # This is a sample script to get complete user's cred roam data (both locally and from AD)
# The script must be executed in the context of the target user on the affected machine and the user must have local admin rights to get all the data
# Replace Win2019DC2.contoso2016.com with the fqdn of the DC
# Output files ... | 0 |
Get-SameTimeChatHistory.ps1 | # TITLE: Get-SameTimeChatHistory.ps1
# PURPOSE: Reads Sametime R8 chat transcript HTML files and outputs custom objects
# AUTHOR: Hal Rottenberg <hal@halr9000.com
# OUTPUT:
# - [datetime] Timestamp - can be easily filtered
# - [string] LastName
# - [string] FirstName
# - [string] Message
#
# REQUIREMENTS:
... | 0 |
4241.ps1 |
function Get-PassPol
{
$domain = [ADSI]"WinNT://$env:userdomain"
$Name = @{Name='DomainName';Expression={$_.Name}}
$MinPassLen = @{Name='Minimum Password Length (Chars)';Expression={$_.MinPasswordLength}}
$MinPassAge = @{Name='Minimum Password Age (Days)';Expression={$_.MinPasswordAge.value/86400}}
$MaxPassAge = ... | 0 |
PSISELibrary.ps1 | Function Replace-TabsWithSpace
{
<#
.SYNOPSIS
Replaces a tab character with 4 spaces
.DESCRIPTION
This function examines the selected text in the PSIE SelectedText property and every tab
character that is found is replaced with 4 spaces.
.PARAMETER... | 0 |
New-Script 1.1.ps1 | ## New-Script function
## Creates a new script from the most recent commands in history
##################################################################################################
## Example Usage:
## New-Script ScriptName 4
## creates a script from the most recent four commands
## New-Script... | 0 |
2043.ps1 |
Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
if ( ! $IsWindows ) {
$PSDefaultParameterValues["it:skip"] = $true
}
else {
[System.Management.Automation.... | 0 |
get-ipinformation.ps1 | function get-ipinformation
{
process {
(Get-WmiObject Win32_NetworkAdapterConfiguration -computer $_ ) | ? { $_.IPenabled } |
select (AS Server , __server,
DNSHostName , DNSHostName ,
Mac , Macaddress,
Description, Description,
DNSDomain , DNSDomain,
... | 0 |
Test-Port_4.ps1 | function Test-Port{
<#
.SYNOPSIS
Tests port on computer.
.DESCRIPTION
Tests port on computer.
.PARAMETER computer
Name of server to test the port connection on.
.PARAMETER port
Port to test
.PARAMETER tcp
Use tcp port
.PARAMETER udp
Use udp port
.PARAMETER UDP... | 0 |
sample_22_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Secrets'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Secrets.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Compat... | 0 |
183.ps1 | function Get-LocalGroup
{
PARAM
(
[Alias('cn')]
[String[]]$ComputerName = $Env:COMPUTERNAME,
[String]$AccountName,
[System.Management.Automation.PsCredential]$Credential
)
$Splatting = @{
Class = "Win32_Group"
Namespace = "root\cimv2"
Filter ... | 0 |
sample_32_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Genericartifactscontent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll'
# Version number of this module.
ModuleVersion = '83.1.0... | 0 |
1880.ps1 |
Describe "Using delimiters with Export-CSV and Import-CSV behave correctly" -tags "Feature" {
BeforeAll {
$delimiters = "/", " ", "@", "
"{", "}", "|", "<", ">", ";", "'",
'"', "~", "!", "%", "^", "*", "_", "+", ":",
"?", "-", "=", "[", "]", "."
$... | 0 |
sample_48_80.ps1 | #
# Module manifest for module 'OCI.PSModules.Computecloudatcustomer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
... | 0 |
4355.ps1 | function Set-EnvironmentVariable
{
param
(
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String]
$Name,
[parameter()]
[String]
$Value,
[parameter(Mandatory = $true)]
[int]
$Target
)
if ($Target -eq $script:En... | 0 |
fc04d684-2f9d-418f-9f82-eaef4aa9cfcd.ps1 | Function Get-DrsGroup {
<#
.SYNOPSIS
Retrieves DRS groups from a cluster.
.DESCRIPTION
Retrieves DRS groups from a cluster.
.PARAMETER Cluster
Specify the cluster for which you want to retrieve the DRS groups
.PARAMETER Name
Specify the name of the DRS group you want to retrieve.
.EXAMPLE
Get-DrsGrou... | 0 |
402.ps1 |
Register-PSFSessionObjectType -DisplayName CimSession -TypeName Microsoft.Management.Infrastructure.CimSession
Register-PSFSessionObjectType -DisplayName PSSession -TypeName System.Management.Automation.Runspaces.PSSession
Register-PSFSessionObjectType -DisplayName SmoServer -TypeName Microsoft.SqlServer.Management.... | 0 |
Get-Command (which).ps1 | ## This ought to be the same as Get-Command, except...
## it will output the commands in the actual order they would be used by the shell
function which( [string]$command ) {
$Script:ErrorActionPreference = "SilentlyContinue"
Get-Command $command -commandType Alias
Get-Command $command -commandType Funct... | 0 |
sample_13_9.ps1 | PARAM ( [string] $SiteToCheck = $null )
#************************************************
# DCSiteInfo.ps1
# Version 1.0
# Date: 1/14/2014
# Author: Tim Springston [MS]
# Description: This script queries for the computers domain
# and returns details about all domain controllers which are in
# the same... | 0 |
1043.ps1 |
[CmdletBinding()]
param(
[Switch]
$SkipWebsite
)
Set-StrictMode -Version Latest
& (Join-Path -Path $PSScriptRoot -ChildPath 'Carbon\Import-Carbon.ps1' -Resolve)
& (Join-Path -Path $PSScriptRoot -ChildPath 'Tools\Silk\Import-Silk.ps1' -Resolve)
$licenseFileName = 'LICENSE.txt'
$noticeFileName = 'NOTICE... | 0 |
Get-NestedGroups v_4.ps1 | Function Global:Get-NestedGroups {
<#
.SYNOPSIS
Enumerate all AD group memberships of an account (including nested membership).
.DESCRIPTION
This script will return the AD group objects for each group the user is a member of.
.PARAMETER UserName
The username whose group memberships to find.
.E... | 0 |
FindNewVirtualMachines_1.ps1 | #requires -pssnapin VMware.Vimautomation.Core
Param(
[int]
$LastDays
)
Process
{
$EventFilterSpecByTime = New-Object VMware.Vim.EventFilterSpecByTime
If ($LastDays)
{
$EventFilterSpecByTime.BeginTime = (get-date).AddDays(-$($LastDays))
}
$EventFilterSpec = New-Object VMwa... | 0 |
VM Last Poweron Time.ps1 | # Get a VM's last power on date based on the VM's events.
# Requires PowerCLI 4.0 and PowerShell v2.
function Get-LastPowerOn {
param(
[Parameter(
Mandatory=$true,
ValueFromPipeline=$true,
HelpMessage="VM"
)]
[VMware.VimAutomation.Types.VirtualMachin... | 0 |
h20 -Hashtables 2 object_3.ps1 | #hashtable to object function.
#used to be able to make custom objects with math inside the pipeline
#examples
# 1..10 | h20 { @{karl = $_;dude = $_+1} }
#modify the incoming data with an expression
# gps | h20 { @{name = $_.processname; mem = $_.workingset / 1MB} }
#easily flatten data with subexpressions... | 0 |
sample_23_98.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Registers or unregisters the PowerShell ETW manifest
.Parameter Path
The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file.
The default value is the location of this script.
.Paramet... | 0 |
sample_43_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Artifacts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Artifacts.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Co... | 0 |
Get-AclMisconfiguration..ps1 | ##############################################################################\n##\n## Get-AclMisconfiguration\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\n... | 0 |
2554.ps1 |
$Files = Get-Content -Path "e:\Dexma\ClientFilePaths.txt"
IF ($Files)
{
foreach ($file IN $Files)
{
IF (Test-Path $file = $true)
{
Out-File -InputObject $file -FilePath "e:\Dexma\logs\ClientFilesFound.txt" -append -NoClobber
}
else
{
Out-File -InputObject $file -FilePath "e:\Dexma\logs\Cli... | 0 |
3157.ps1 | $global:ThemeSettings = New-Object -TypeName PSObject -Property @{
CurrentThemeLocation = "$PSScriptRoot\Themes\Agnoster.psm1"
MyThemesLocation = '~\Documents\WindowsPowerShell\PoshThemes'
ErrorCount = 0
PromptSymbols = @{
StartSymbol = ' '
Truncat... | 0 |
sample_58_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingingestion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported... | 0 |
sample_5_44.ps1 | #************************************************
# DC_Setup_Addons.ps1
# Version 1.1
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects additional Setup information.
# Called from: TS_AutoAddCommands_Setup.ps1
#*******************************************************
Param... | 0 |
1814.ps1 |
Describe "Test-Path" -Tags "CI" {
BeforeAll {
$testdirectory = $TestDrive
$testfilename = New-Item -path $testdirectory -Name testfile.txt -ItemType file -Value 1 -force
New-Item -Path $testdirectory -Name datestfile -value 1 -ItemType file | Out-Null
New-Item -Path $test... | 0 |
sample_13_14.ps1 | ConvertFrom-StringData @'
id_appliedsectemploutput=Applied Security Templates
id_appliedsectemplobtaining=Gathering applied security templates
'@
# SIG # Begin signature block
# MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... | 0 |
sample_28_64.ps1 | #
# Module manifest for module 'OCI.PSModules.Appmgmtcontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSE... | 0 |
get-DiskVolumeInfo_1.ps1 | function get-DiskVolumeInfo
{
<#
.SYNOPSIS
Returns information about disk volumes including freespace
.DESCRIPTION
Returns information about disk volumes including freespace
.EXAMPLE
show-InnerException ExceptionObject
Shows the in... | 0 |
sample_39_42.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
2611.ps1 | param([Switch]$SqlOnly)
Import-Module C:\git-repositories\PowerShell\MSFVMLab\MSFVMLab.psm1 -Force
$LabConfig = Get-Content C:\git-repositories\PowerShell\MSFVMLab\LabVMS.json | ConvertFrom-Json
$Servers = if($SqlOnly){$LabConfig.Servers | Where-Object {$_.class -ne 'DomainController'}} else {$LabConfig.Servers}
$Wor... | 0 |
1096.ps1 |
function Test-FunctionsShouldUseUseCallerPreference
{
$files = Get-ChildItem -Path (Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon\Functions\*.ps1') -File |
Where-Object { $_.BaseName -ne 'Use-CallerPreference' } |
Where-Object { -not ($_ | Select-String -Pattern 'Us... | 0 |
1836.ps1 |
Describe "Clear-Item tests" -Tag "CI" {
BeforeAll {
${myClearItemVariableTest} = "Value is here"
}
It "Clear-Item can clear an item" {
$myClearItemVariableTest | Should -BeExactly "Value is here"
Clear-Item -Path variable:myClearItemVariableTest
Test-Path -Path variable:my... | 0 |
sample_42_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Aidocument'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aidocument.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
... | 0 |
sample_63_83.ps1 | <#
.SYNOPSIS
SyncServiceIIS.ps1 script file
This is a place-holder file only for agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3Ag... | 0 |
sample_3_2.ps1 | #************************************************
# DC_DhcpServer-Component.ps1
# Version x
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about DHCP Server.
# Called from: Networking Diags
#*******************************************************
Trap [Exce... | 0 |
sample_19_80.ps1 | ---
title: Powershell
description: Powershell snippets on the rocks.
---
## [cotrWhileLoop](/snippets/cotrwhileloop)
PowerShell While Loop
```powershell
while (${1:condition}) {
# Your code here
}
```
## [cotrEqual](/snippets/cotrequal)
PowerShell Equal To
```powershell
-eq
```
## [cotrNotEqual](/snippets/cotr... | 0 |
sample_34_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Blockchain'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Blockchain.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
... | 0 |
Get-CrawlHealth (MOSS).ps1 | [reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") | out-null
@@#NOTE: I've set strict crawl freshness/crawl duration/success rati... | 0 |
ConvertTo-MultiArray.ps1 | function ConvertTo-MultiArray {
<#
.Notes
NAME: ConvertTo-MultiArray
AUTHOR: Tome Tanasovski
Website: http://powertoe.wordpress.com
Twitter: http://twitter.com/toenuff
Version: 1.0
CREATED: 11/5/2010
LASTEDIT:
11/5/2010 1.0
Initial Release
.Synopsis
Converts a collection of PowerShell obj... | 0 |
sample_49_91.ps1 | <#
.SYNOPSIS
Creates and throws an invalid argument exception.
.PARAMETER Message
The message explaining why this error is being thrown.
.PARAMETER ArgumentName
The name of the invalid argument that is causing this error to be thrown.
#>
function New-InvalidArgumentExcept... | 0 |
sample_27_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingsearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEdi... | 0 |
Colorize Subversion SVN_5.ps1 | # detect source control management software
function findscm {
$scm = ''
:selectscm foreach ($_ in @('svn', 'hg')) {
$dir = (Get-Location).ProviderPath.trimEnd("\\")
while ($dir.Length -gt 3) {
if (Test-Path ([IO.Path]::combine(($dir), ".$_"))) {
$scm = $_
break selectscm
}
$dir =... | 0 |
sample_17_73.ps1 | ConvertFrom-StringData @'
id_printcsrbloatingcheck_st=Possible client size rendering registry bloat detected
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCW... | 0 |
sample_45_0.ps1 |
# ENV
# WARNING: these need to be setup by your launch script or CI/CD
# $env:TEST_DEVICE_HOSTNAME = "verdin-imx8mm-06827750.local"
# $env:TEST_DEVICE_LOGIN = "torizon"
# $env:TEST_DEVICE_PASSWORD = "1234"
# $env:TEST_DEVICE_ARCH = "arm64"
# $env:TEST_DEVICE_IP = "192.168.0.62"
# $env:TEST_LOCAL_DEBUG = "true"
# $env:... | 0 |
Write-Log_1.ps1 | function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true,Mandatory=$true)] [ValidateNotNullOrEmpty()]
[string] $Message,
[Parameter()] [ValidateSet(“Error”, “Warn”, “Info”)]
[string] $Level = “Info”,
[Parameter()] [ValidateRange(1,30)]
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.