filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
3459.ps1
function Test-SelfHosted-IntegrationRuntime { $dfname = Get-DataFactoryName $rgname = Get-ResourceGroupName $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-ProviderLocation DataFactoryManagement New-AzResourceGroup -Name $rgname -Location $rglocation -F...
0
Split-String_2.ps1
function Split-String { #.Synopsis # Split a string and execute a scriptblock to give access to the pieces #.Description # Splits a string (by default, on whitespace), and assigns it to $0, and the first 9 words to $1 through $9 ... and then calls the specified scriptblock #.Example # echo "this is one test ff...
0
sample_63_29.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
0
1955.ps1
Describe "Register-EngineEvent" -Tags "CI" { Context "Check return type of Register-EngineEvent" { It "Should return System.Management.Automation.PSEventJob as return type of Register-EngineEvent" { Register-EngineEvent -SourceIdentifier PesterTestRegister -Action {Write-Output registerengineevent} | Shoul...
0
4097.ps1
[CmdletBinding()] param () function Get-RelativePath { [CmdletBinding()][OutputType([string])] param () $Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\" Return $Path } Function Install-Fonts { Param ([String]$SourceDirectory, [String]$FontType) $FontType = "*." + $FontT...
0
sample_32_70.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # 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 License at # http://www.apa...
0
New-Event.ps1
#.Synopsis # Parse natural language descriptions of appointments or meetings ... #.EXAMPLE @@# New-Event Lunch every other Friday at 11:45 @@# @@# day_of_week interval start_date start_time type message @@# ----------- -------- ---------- ---------- ---- ------- @@# fri 2 20100122 11:...
0
337.ps1
function Remove-PSFAlias { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] [CmdletBinding()] param ( [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [string[]] $Name, [switch] $Force ) process ...
0
New-SQLComputerLogin.ps1
function New-SQLComputerLogin { param( [Parameter(Mandatory=$True,Position=0)] [String]$SQLServer, [Parameter(Mandatory=$True,Position=1)] [String]$ComputerName, [Switch]$Force ) ## Import-Module QAD, SQLPS -DisableNameChecking $Computer = Get-QADComputer $ComputerName #$NTAccountName = $Computer.NTA...
0
Export-SPListToSQL_1.ps1
#Change these settings as needed #MS Access 2007 Data Components required $connString = 'Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes; DATABASE=http://sharepoint.acme.com/;LIST={96801432-2d03-42b8-82b0-ac96ca9fea8a};' #See http://chadwickmiller.spaces.live.com/blog/cns!EA42395138308430!275.entry for ...
0
1774.ps1
Import-Module HelpersSecurity try { $defaultParamValues = $PSDefaultParameterValues.Clone() $PSDefaultParameterValues["it:Skip"] = !$IsWindows Describe "Help built-in function should not expose nested module private functions when run on locked down systems" -Tags 'Feature','RequireAdminOnWin...
0
sample_40_9.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.LoadTesting.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Module]::Instance # Export nothing to clear implicit ex...
0
Get-MWSOrder_1.ps1
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="GetOrderCmdlet.cs" company="Huddled Masses"> // Copyright (c) 2011 Joel Bennett // </copyright> // <summary> // Defines the Get-Order Cmdlet for Amazon Marketplace Orders ...
0
Set-TopMost_1.ps1
#Requires -Version 2.0 $signature = @" [DllImport("user32.dll")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); public static IntPtr FindWindow(string windowName){ return FindWindow(null,windowName); } [DllImport("user32.dll")] public static extern bool Se...
0
sample_61_66.ps1
# # Module manifest for module 'OCI.PSModules.Recovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Recovery.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions Comp...
0
Select-Alive.ps1
filter Select-Alive { param ( [switch]$Verbose ) trap { Write-Verbose "$(get-date -f 's') ping failed: $computer" continue } if ($Verbose) { $VerbosePreference = "continue" $ErrorActionPreference = "continue" } else { $VerbosePreference = "silentlycontinue" $ErrorActionPreference = "silent...
0
2570.ps1
param( $SqlServerOne = 'YourDatabaseServer', $FirstDatabase = 'FirstDatabaseToCompare', $SqlServerTwo = 'YourDatabaseServer', $SecondDatabase = 'SecondDatabaseToCompare', [String[]] $DatabaseList, $FilePrefix = 'Log', [switch]$Log, [switch]$Column ) $File = $FilePrefix + '{0}-{1}.csv' $ScriptName = [system...
0
Send-HTMLFormattedEmail_2.ps1
################################################## # cmdlets ################################################## #------------------------------------------------- # Send-HTMLFormattedEmail #------------------------------------------------- # Usage: Send-HTMLFormattedEmail -? #------------------------------------...
0
exclude properties_.ps1
$server = "dcserver1.mafoberg.net" $session = new-pssession -computer $server -cred $creds icm -Session $session -ScriptBlock { import-module activedirectory (get-ADUser -filter "*" -properties GivenName, SurName, EmailAddress | select -ExcludeProperty PSComputerName, RunspaceId, PSShowComputerName ) ...
0
Get-RemoteRegistry_2.ps1
## Get-RemoteRegistry ######################################################################################## ## Version: 2.1 ## + Fixed a pasting bug ## + I added the "Properties" parameter so you can select specific registry values ## NOTE: you have to have access, and the remote registry service has to be r...
0
3029.ps1
function Parse-ShouldArgs([object[]] $shouldArgs) { if ($null -eq $shouldArgs) { $shouldArgs = @() } $parsedArgs = @{ PositiveAssertion = $true ExpectedValue = $null } $assertionMethodIndex = 0 $expectedValueIndex = 1 if ($shouldArgs.Count -gt 0 -and $shouldArg...
0
4274.ps1
function Bypass-UAC { param( [Parameter(Mandatory = $True)] [ValidateSet('UacMethodSysprep','ucmDismMethod','UacMethodMMC2','UacMethodTcmsetup','UacMethodNetOle32')] [String]$Method, [Parameter(Mandatory = $False)] [String]$CustomDll = $null ) funct...
0
sample_58_57.ps1
Set-StrictMode -Version Latest Import-Module (Join-Path $PSScriptRoot "Events.psm1") Write-EventLog @EVL_CURTAINAPP -Message "Launching CurtainApp" & $PSScriptRoot\CurtainApp\CurtainApp.exe --timeout 300 --mode "outofpackage" & $Env:SystemDrive\Rigel\x64\Scripts\Provisioning\ScriptLaunch.ps1 ApplyConfig.ps1 -...
0
4061.ps1
Function AddRemovePrograms($KeyName, $DisplayName, $Version){ New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT Set-Variable -Name AddRemKey -Scope Local -Force Set-Variable -Name guid -Scope Local -Force Set-Variable -Name ProductsKey -Scope Local -Force ...
0
3739.ps1
$pfxpwd='123' $securepfxpwd=$pfxpwd | ConvertTo-SecureString -AsPlainText -Force $expires= (Get-Date).AddYears(2).ToUniversalTime() $nbf=(Get-Date).ToUniversalTime() $newexpires= (Get-Date).AddYears(5).ToUniversalTime() $newnbf=(Get-Date).AddYears(1).ToUniversalTime() $ops = "decrypt", "verify" $newops = "encrypt",...
0
Get-WindowsExperience.ps1
function Get-WindowsExperienceRating { #.Synopsis # Gets the Windows Experience Ratings #.Parameter ComputerName # The name(s) of the computer(s) to get the Windows Experience (WinSat) numbers for. [CmdletBinding()] param( [Parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [string[...
0
sample_57_13.ps1
function Update-AzFunctionAppSetting { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20231201.IStringDictionary])] [Microsoft.Azure.PowerShell.Cmdlets.Functions.Description('Adds or updates app settings in a function app.')] [CmdletBinding(DefaultParameterSetName='ByName', SupportsS...
0
Get-Comic.ps1
#.Synopsis # Download comic strip images #.Description # Gets the latest comic from any of several different comic strips and downloads it to "My Pictures\\Comix" #.Parameter comic # The name of the comic to fetch: xkcd, dilbert, uf (user friendly) #.Notes # DEPEND-ON -Module HttpRest poshcode.org/787 # DEPE...
0
2886.ps1
BuildTearDown { $script:buildTearDown_Sequence += "executing build teardown" [string]$expected = "Compiling;Testing;Deploying;executing build teardown" if ($script:buildTearDown_Sequence -ne $expected) { throw "Expected sequence '$expected', but was actually '$script:buildTearDown_Sequence'" } }...
0
sample_50_44.ps1
# # Module manifest for module 'OCI.PSModules.Fusionapps' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions ...
0
3553.ps1
$containerName = "pstestwlvm1bca8" $resourceGroupName = "pstestwlRG1bca8" $vaultName = "pstestwlRSV1bca8" $resourceId = "/subscriptions/da364f0f-307b-41c9-9d47-b7413ec45535/resourceGroups/pstestwlRG1bca8/providers/Microsoft.Compute/virtualMachines/pstestwlvm1bca8" $policyName = "HourlyLogBackup" functio...
0
sample_59_38.ps1
$global:VerbosePreference = 'Continue' Function Write-Custom-Output { Param([string]$message) $date = Get-Date $newMessage = '[{0}] {1}' -f $date, $message Write-Output $newMessage } trap [Exception] { Write-Custom-Output "WARN: Terminating error encountered on line $($_.Invoc...
0
d657a0f0-47e1-4233-9e3b-cffc0495188f.ps1
function Start-ISE () { <# .synopsis Load some file into ISE .Description Load some file into ISE .Parameter fileObjOrFileName file to be loaded .ReturnValue $null .Notes Author: bernd kriszio e-mail: bkriszio@googlemail.com ...
0
141.ps1
function Get-AuthToken { [cmdletbinding()] param ( [Parameter(Mandatory=$true)] $User ) $userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User $tenant = $userUpn.Host Write-Host "Checking for AzureAD module..." $AadModule = Get-Module -Name "AzureAD" -ListAvailable if ($Aa...
0
sample_24_91.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Manda...
0
sample_34_28.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 = '74.1.0' # Supported PSE...
0
sample_53_3.ps1
# # Module manifest for module 'OCI.PSModules.Database' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Database.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Comp...
0
sample_36_67.ps1
#!/usr/bin/env pwsh <# .SYNOPSIS Stub around Invoke-Pester command used by VSCode PowerShell extension. .DESCRIPTION The stub checks the version of Pester and if >= 4.6.0, invokes Pester using the LineNumber parameter (if specified). Otherwise, it invokes using the TestName parameter (if specif...
0
Get-WebFile 3.7.2.ps1
## Get-WebFile (aka wget for PowerShell) ############################################################################################################## ## Downloads a file or page from the web ## History: ## v3.7.2 - Puts a try-catch block around $writer = new-object System.IO.FileStream and returns/breaks to ## ...
0
sample_23_24.ps1
@{ IncludeRules = @( 'PSPlaceOpenBrace', 'PSPlaceCloseBrace', 'PSUseConsistentWhitespace', 'PSUseConsistentIndentation', 'PSAlignAssignmentStatement', 'PSUseCorrectCasing' ) Rules = @{ PSPlaceOpenBrace = @{ Enable ...
0
7697c70c-75c8-4a8e-86cd-5e8f3f2f1eb7.ps1
Function PowerOn-VM($vm){ Start-VM -VM $vm -Confirm:$false -RunAsync | Out-Null do { $vmview = get-VM $vm | Get-View $status = $vmview.Guest.ToolsStatus Write-Host $vm is starting! -ForegroundColor Yellow sleep 5 }until(($status -match "toolsOld") -or ($status -match "toolsOk")) ...
0
1789.ps1
Describe "Basic FileSystem Provider Tests" -Tags "CI" { BeforeAll { $testDir = "TestDir" $testFile = "TestFile.txt" $restoreLocation = Get-Location } AfterAll { Set-Location -Path $restoreLocation } BeforeEach { Set-Location -Path "TestDrive:\" ...
0
WindowsInstallPoint.ps1
function Initialize-WindowsInstallPoint { <# .SYNOPSIS Initializes a drive to become a Windows OS install point. .DESCRIPTION The Initialize-WindowsInstallPoint function uses the "diskpart" utility to wipe, partition, and format a local or removable drive. The "bootsect" tool processes the bootmgr all...
0
4430.ps1
function Get-CredsFromCredentialProvider { [CmdletBinding()] Param ( [Parameter()] [ValidateNotNullOrEmpty()] [Uri] $SourceLocation, [Parameter()] [bool] $isRetry = $false ) Write-Verbose "PowerShellGet Calling 'CallCredProvider' on $Source...
0
sample_34_27.ps1
function Set-AzDataProtectionMSIPermission { [OutputType('System.Object')] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact = 'High')] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Grants required permissions to the backup vault and other resources for confi...
0
sample_62_89.ps1
<# .SYNOPSIS Simplify data collection and diagnostics for troubleshooting Microsoft Remote Desktop (RDP/RDS/AVD/W365) related issues and a convenient method for submitting and following quick & easy action plans. .DESCRIPTION This script is designed to gather information to assist Microsoft Customer Suppo...
0
sample_66_73.ps1
# # Module manifest for module 'Microsoft.SME.RemoteDesktop' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.RemoteDesktop.psm1' # Version number of this module. ModuleVersion = '4.21.0' # Supported PSEditions # CompatiblePSEditions = @() # ID us...
0
2191.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=$true, HelpMess...
0
sample_27_97.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
0
sample_27_18.ps1
)이 설정은 네트워크 보호에 대한 DNS TCP 구문 분석을 비활성화합니다.%이 설정은 네트워크 보호에 대한 SSH 구문 분석을 비활성화합니다.i관리자가 특정 채널(링)에서 Microsoft Defender 플랫폼 업데이트를 수신하도록 장치를 구성할 수 있도록 허용 - 고객이 점진적 릴리스 프로세스를 일부 제어할 수 있도록 합니다.베타미리 보기준비됨넓은지연됨h관리자가 특정 채널(링)에서 Microsoft Defender 엔진 업데이트를 수신하도록 장치를 구성할 수 있도록 허용 - 고객이 점진적 릴리스 프로세스를 일부 제어할 수 있도록 합니다.n관리자가 특정 ...
0
sample_50_13.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # 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 License at # http://www.apa...
0
sample_24_51.ps1
# # Module manifest for module 'OCI.PSModules.Bastion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bastion.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Compat...
0
Map a Network Drive.ps1
function MapNetDrive { param( #Non-Boolean parameters (Values) # [Parameter(Position=0,Mandatory=$true)] [string]$DriveLetter="Z:", [Parameter(Position=1,Mandatory=$true)] [string]$Path, #Boolean switches (On/Off) # [Parameter(Position=2,Mandatory=$false)]...
0
2225.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true,HelpMessage="Site Server where SQL Server Reporting Services are installed")] [ValidateScript({Test-Connection -ComputerName $_ -Count 1})] [string]$ReportServer, [parameter(Mandatory=$true,HelpMessage="SiteCode of the Repor...
0
sample_10_2.ps1
#************************************************ # TS_ServicingCorruptionCheck.ps1 # Version 1.0.1 # Date: 12/28/2012 # Author: v-kaw # Description: [Idea ID 5712] [Windows] Run Dism checkhealth on Win8 or 2012 to detect possible servicing corruption # Rule number: 5712 # Rule URL: http://sharepoint/sites/ru...
0
2804.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT count ( ComputerStatus, CriticallyFailedDetections, PendingFullScan, PendingManualSteps, PendingOfflineScan, PendingReboot, RecentlyCleanedDetections, SchemaVersion) AS cnt, Com...
0
out-form with sort colum_2.ps1
# I think OUT-FORM is a very usefull function. I've added code to sort columns by clicking on headers. # You nedd just add the columnTag parameters specifing if colunm value is text or numeric: # out-form -data (get-process) -columnNames ("Name", "ID" ) -columnProperties ("Name", "ID") -columnTag ("Text", "Numeri...
0
sample_43_23.ps1
$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise.msi'; if ([Environment]::Is64BitProcess) { $url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi' } Write-Host "Downloading Google Chrome Beta" $wc = New-Object net.webcl...
0
sample_29_22.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=IP 地址: {0} NetworkNameDisplayNameFormat=名称: {0} NetworkNameOfflineDisplayNameFormat=IP 地址:“{0}”上的地址 CreateClusterProgressValidationStart=正在验证故障转移群集的服务器适用性。 CreateClusterProgressValidationEnd=验证故障转移群集的服务器适用性完成。 CreateClusterProgressCreationStartFormat=正在创建故障转移群集...
0
2515.ps1
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null $credential = Get-Credential $loginName = $credential.UserName $password = $credential.Password $Excel = New-Object -ComObject Excel.Application $Excel.visible = $False $Workbook = $Excel.Workbooks.Add() $srvlist = @(get-co...
0
2357.ps1
if (!(Get-Module 'GroupPolicy') -or !(Get-Module 'Internal')) { Write-Error 'One or more required modules not loaded'; return; } $bRemediate = $false; $aDefaultGpos = @('Default Domain Controllers Policy'); $aGposToRead = Get-GPOReport -ReportType XML -All; foreach ($sGpo in $aGposToRead) { $xGpo = (...
0
3491.ps1
function Test-GetBlueprintAssignment { $assignments = Get-AzBlueprintAssignment Assert-True { $assignments.Count -ge 1 } Assert-NotNull $assignments[0].Name Assert-NotNull $assignments[0].Id Assert-NotNull $assignments[0].BlueprintId Assert-NotNull $assignments[0].Scope Assert-NotNull $assignments[0].Loca...
0
sample_59_62.ps1
const e=Object.freeze({displayName:"nushell",name:"nushell",patterns:[{include:"#define-variable"},{include:"#define-alias"},{include:"#function"},{include:"#extern"},{include:"#module"},{include:"#use-module"},{include:"#expression"},{include:"#comment"}],repository:{binary:{begin:"\\b(0x)(\\[)",beginCaptures:{1:{name...
0
sample_19_11.ps1
#************************************************ # DC_HyperVBasicInfo.ps1 # Version 1.0 # Date: 4-7-2015 # Author: Ryutaro Hayashi <Ryutaro.Hayashi@microsoft.com> # Ported to SDP and included in HyperV SDP by Tim Springston <tspring@microsoft.com> # Description: Data collection for hyperv. #********************...
0
2133.ps1
Describe "Using of ternary operator" -Tags CI { BeforeAll { $skipTest = -not $EnabledExperimentalFeatures.Contains('PSTernaryOperator') if ($skipTest) { Write-Verbose "Test Suite Skipped. The test suite requires the experimental feature 'PSTernaryOperator' to be enabled." -Verbose ...
0
sample_67_28.ps1
function Show-TableData { param ( [Parameter(Mandatory = $true)] [string]$TableName, [Parameter(Mandatory = $false)] $LaunchConfig ) $ServiceUrl = Get-ServiceUrl -Method GetTableIDFromName -LaunchConfig $LaunchConfig $Credential = Get-ALTestRunnerCredential ...
0
sample_19_95.ps1
@{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'https://aka...
0
sample_18_29.ps1
# # Module manifest for module 'OCI.PSModules.Licensemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSE...
0
sample_33_22.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_35_78.ps1
# # Module manifest for module 'OCI.PSModules.Limits' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Limits.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Compatib...
0
sample_9_5.ps1
ConvertFrom-StringData @' id_printerkb982728checkrt=Printer mapping may fail with an error message when you try to create a Point and Print connection and a Kyocera printer is installed '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorB...
0
738.ps1
function Set-RsSubscription { [CmdletBinding()] param ( [string] $ReportServerUri, [System.Management.Automation.PSCredential] $Credential, $Proxy, [parameter(Mandatory = $false)] [DateTime]$StartDateTime, [parameter(Mandatory = $false)] [DateTime]$EndDate, ...
0
Rotate-Right.ps1
function Rotate-Right { <# .SYNOPSIS Performs a binary rotate right operation. Author: Matthew Graeber (@mattifestation) .DESCRIPTION Rather than implementing the logic to perform a binary rotate operation, Rotate-Right wraps the private methods contained within System.Security.Cryptography.SHA256Managed and ...
0
3012.ps1
function New-PesterState { param ( [String[]]$TagFilter, [String[]]$ExcludeTagFilter, [String[]]$TestNameFilter, [System.Management.Automation.SessionState]$SessionState, [Switch]$Strict, [Pester.OutputTypes]$Show = 'All', [object]$PesterOption, [Switc...
0
1078.ps1
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve) Describe 'Write-File' { $file = '' BeforeEach { $Global:Error.Clear() $file = Join-Path -Path 'TestDrive:' -ChildPath ([IO.Path]::GetRandomFileName()) New-Item -Path $file -ItemType 'File' $...
0
Add new smtp_set prmary_4.ps1
#alias,addnewemailaddress import-csv .\\source.csv | foreach { $user = Get-Mailbox $_.alias $user.emailAddresses+= $_.addnewemailaddress $user.primarysmtpaddress = $_.addnewemailaddress Set-Mailbox $user -emailAddresses $user.emailAddresses set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress }
0
Get-PerformanceCounter.ps1
function Get-PerformanceCounter { <# .Synopsis Gets one or more Performance Counter objects. .Description This function will use .NET to retrieve a single Counter or all counters for a particular Instance and Category. .Parameter category The Performance Counter Category. ...
0
Start-Verify_3.ps1
# Author: Steven Murawski http://www.mindofroot.com # This script creates two functions (and a helper function). One starts logging all commands entered, # and the second removes the logging. # This script is similar to the Start-Transcript, but only logs the command line and not the output. # Modified to add ...
0
4095.ps1
cls Set-Variable -Name Computer -Scope Global -Force Set-Variable -Name Active -Scope Global -Force Set-Variable -Name Network -Scope Global -Force Set-Variable -Name Networks -Scope Global -Force Set-Variable -Name Output -Scope Global -Force Set-Variable -Name RetVal -Scope Global -Force $Comp...
0
1515.ps1
function Test-NodeExists { [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0)] [xml] $Xml, [Parameter(Mandatory=$true,Position=1)] [string] $XPath, [Parameter(Position=2)] [string] ...
0
164.ps1
function show-object { param( [Parameter(ValueFromPipeline = $true)] $InputObject ) Set-StrictMode -Version 3 Add-Type -Assembly System.Windows.Forms $rootVariableName = Get-ChildItem variable:\* -Exclude InputObject,Args | Where-Object { $_.Value -and ($_.Value.GetType(...
0
sample_32_14.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> [DscLocalConfigurationManager()] Configuration ...
0
Add new smtp_set prmary.ps1
#alias,addnewemailaddress import-csv .\\source.csv | foreach { $user = Get-Mailbox $_.alias $user.emailAddresses+= $_.addnewemailaddress $user.primarysmtpaddress = $_.addnewemailaddress Set-Mailbox $user -emailAddresses $user.emailAddresses set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress }
0
sample_31_50.ps1
# # Module manifest for module 'OCI.PSModules.Datacatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEdition...
0
JSON 1.5.ps1
#requires -version 2.0 # Version History: # v 0.5 - First Public version # v 1.0 - Made ConvertFrom-Json work with arbitrary JSON # - switched to xsl style sheets for ConvertTo-JSON # v 1.1 - Changed ConvertFrom-Json to handle single item results # v 1.2 - CodeSigned to make a fellow geek happy # v 1.3 - ...
0
sample_66_93.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
chkhash_25.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.Open...
0
Audit NTFS on Shares.ps1
$Excel = New-Object -Com Excel.Application $Excel.visible = $True $Excel = $Excel.Workbooks.Add() $wSheet = $Excel.Worksheets.Item(1) $wSheet.Cells.item(1,1) = "Folder Path:" $wSheet.Cells.Item(1,2) = "Users/Groups:" $wSheet.Cells.Item(1,3) = "Permissions:" $wSheet.Cells.Item(1,4) = "Permissions Inherited:" ...
0
sample_56_71.ps1
# # Module manifest for module 'OCI.PSModules.Goldengate' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Goldengate.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions ...
0
Pause-Script & Out-More.ps1
# Pause-Script # # Pauses execution until a key is pressed. function Pause-Script { param([string]$message = 'Press any key to continue...') Write-Host -NoNewLine $message $null = $Host.UI.RawUI.ReadKey("NoEcho, IncludeKeyDown") Write-Host "" } # Out-More # # Displays one window's worth of data...
0
sample_28_54.ps1
# # Module manifest for module 'OCI.PSModules.Queue' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Queue.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
0
sample_52_78.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
4425.ps1
function Find-DscResource { [CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=517196')] [outputtype('PSCustomObject[]')] Param ( [Parameter(Position = 0)] [ValidateNotNullOrEmpty()] [string[]] $Name, [Parameter()] [ValidateNotNullOrEm...
0
2288.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter( Mandatory = $true, HelpMessage = "Define user principal name for the service account. As a best practice, always use your tenant suffix and not a verified domain." )] [ValidateNotNullOrEmpty()] [string]$UserPrincipalName, ...
0
855.ps1
param( [Parameter(Mandatory=$true)] [string]$ResourceGroup, [Parameter(Mandatory=$true)] [string]$StorageAccountName, [Parameter(Mandatory=$true)] [string]$ContainerName ) $VerbosePreference = "Continue" if((Get-Module -ListAvailable Az.Storage) -eq $null) { throw "Azure Powe...
0
sample_52_44.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Join-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([System.Management.Automation.Language.IScriptExtent])] param( [Parameter(Value...
0
sample_61_44.ps1
# # Script module for module 'Az.CosmosDB' that is executed when 'Az.CosmosDB' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 07/04/2024 08:22:40 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
0
sample_65_31.ps1
$ServerCertificateName = "CN=ServiceFabricServerCert" $ClientCertificateName = "CN=ServiceFabricClientCert" function IsSecurityX509([string]$ClusterConfigFilePath) { $jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json $properties = $jsonConfig.properties if ($properties -ne $Nul...
0
CommandTranscript_1.ps1
if(!$global:CommandTranscriptPrompt) { ## Record the original prompt so we can put it back if they change their minds... $global:CommandTranscriptPrompt = ${Function:Prompt} } function Test-CommandTranscript { #.Synopsis # Tests whether or not a current command transcript is in place. return $global:Com...
0
sample_34_85.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