full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Get-FaceList.ps1
Get-FaceList.ps1
function Get-FaceList { [CmdletBinding(DefaultParameterSetName="ListAll")] param( [parameter( Mandatory=$false, Position=1, ParameterSetName='byName') ] [String]$name , [parameter( Mandatory=$false, P...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Remove-Person.Tests.ps1
Remove-Person.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "RemovePerson" { New-PersonGroup "pester-1" Context "When a person is being deleted by name" { New-Person -name "pester-person-1" -personGroupId "pester-1" Re...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/New-PersonGroup.ps1
New-PersonGroup.ps1
function New-PersonGroup { param( [parameter( Mandatory=$true, Position=1 )] [string] $personGroupId , [parameter(Mandatory=$false)] [string] $name , [parameter(Mandatory=$false)] [string] $userData = ""...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/New-FaceList.ps1
New-FaceList.ps1
function New-FaceList { param( [parameter( Mandatory=$true, Position=1 )] [string] $name , [parameter(Mandatory=$false)] [string] $faceListId , [parameter(Mandatory=$false)] [string] $userData = "" ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Invoke-VerifyFaces.Tests.ps1
Invoke-VerifyFaces.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "InvokeVerifyFaces" { Context "When test data should be used"{ It "Should be available for testing"{ Test-Path "$here\..\SampleImages\Face_01.JPG" | Should Be $true ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/New-PersonFace.Tests.ps1
New-PersonFace.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "NewPersonFace" { New-PersonGroup "pester-persongroup-1" New-Person "pester-person-1" -personGroupId "pester-persongroup-1" Context "When test data should be used"{ I...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/New-FaceList.Tests.ps1
New-FaceList.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "NewFaceList" { Context "When a face list is being created" { New-FaceList "pester-1" $result = Get-FaceList "pester-1" It "Should exist" { ($result ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Initialize-Secrets.ps1
Initialize-Secrets.ps1
function Initialize-Secrets { param( [parameter(Mandatory=$false)] [string]$SecretJSON = "./secrets.json" ) try { $secrets = Get-Content $SecretJSON $objSecrets = $secrets | ConvertFrom-Json } catch [System.Exception] { throw "Error loading secrets `n"...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Start-PersonGroupTraining.ps1
Start-PersonGroupTraining.ps1
function Start-PersonGroupTraining { param( [parameter( Mandatory=$true, Position=1 ) ] [String]$PersonGroupId ) $Request = "https://api.projectoxford.ai/face/v1.0/persongroups/$PersonGroupId/train" $Response = Invoke-MSCognitiveSer...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/New-FaceListFace.Tests.1.ps1
New-FaceListFace.Tests.1.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "NewFaceListFace" { Context "When test data should be used"{ It "Should be available for testing"{ Test-Path "$here\..\SampleImages\Face_01.JPG" | Should Be $true ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Set-PersonGroup.ps1
Set-PersonGroup.ps1
function Set-PersonGroup { param( [parameter( Mandatory=$true, Position=1 )] [string] $personGroupId , [parameter(Mandatory=$false)] [string] $name , [parameter(Mandatory=$false)] [string] $userData = ""...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/New-FaceListFace.ps1
New-FaceListFace.ps1
function New-FaceListFace { param( [parameter( Mandatory=$true, ParameterSetName='byFaceListNameAndLocalImage' )] [parameter( Mandatory=$true, ParameterSetName='byFaceListNameAndImageUrl' )] [string] $faceList...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Get-Secrets.ps1
Get-Secrets.ps1
function Get-Secrets { Write-Host "ApiKey: " $Script:ApiKey }
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/New-Person.Tests.ps1
New-Person.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "NewPerson" { Context "When a person is being created" { New-PersonGroup "pester-persongroup-1" New-Person "pester-person-1" -personGroupId "pester-persongroup-1" $...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Remove-PersonFace.ps1
Remove-PersonFace.ps1
function Remove-PersonFace { [CmdletBinding(DefaultParameterSetName="byPersonName")] param( [parameter( Mandatory=$true, Position=1, ParameterSetName='byPersonName') ] [String]$personName , [parameter( Mandatory=...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Set-Person.Tests.ps1
Set-Person.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "SetPerson" { New-PersonGroup "pester-1" Context "When a person name is being modified" { New-Person -name "pester-person-1" -personGroupId "pester-1" Set-Person -nam...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Get-PersonGroup.Tests.ps1
Get-PersonGroup.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" New-PersonGroup "pester-1" New-PersonGroup "pester-2" Describe "GetPersonGroups" { Context "When all Person Groups are requested" { $result = Get-PersonGroup It "Returns more tha...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Get-FaceList.Tests.ps1
Get-FaceList.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" New-FaceList "pester-1" -faceListId "pester-1-id" New-FaceList "pester-2" -faceListId "pester-2-id" New-FaceList "pester-3" -faceListId "pester-3-id" Describe "GetFaceList" { Context "When a sing...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Set-FaceList.Tests.ps1
Set-FaceList.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "SetFaceList" { Context "When a face list name is modified" { New-FaceList -name "pester-1-name" -faceListId "pester-1-id" -userData "pester-1-userdata" Set-FaceList -name "...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/New-Person.ps1
New-Person.ps1
function New-Person { param( [parameter( Mandatory=$true, Position=1 )] [string] $name , [parameter(Mandatory=$true)] [string] $personGroupId , [parameter(Mandatory=$false)] [string] $userData = "" ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Remove-FaceList.ps1
Remove-FaceList.ps1
function Remove-FaceList { param( [parameter( Mandatory=$true, Position=1 )] [string] $faceListId ) $Request = "https://api.projectoxford.ai/face/v1.0/facelists/$faceListId" $Response = Invoke-MSCognitiveServiceRequest -Method 'DELETE' -Uri...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Set-FaceList.ps1
Set-FaceList.ps1
function Set-FaceList { [CmdletBinding(DefaultParameterSetName="ByName")] param( [parameter( Mandatory=$true, Position=1, ParameterSetName='ByName' )] [string] $name , [parameter( Mandatory=$true, ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Start-PersonGroupTraining.Tests.ps1
Start-PersonGroupTraining.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "StartPersonGroupTraining" { Context "When a person group without persons starts training" { New-PersonGroup "pester-1" It "Should not throw" { {Start-PersonGro...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Get-PersonFace.ps1
Get-PersonFace.ps1
function Get-PersonFace { param( [parameter( Mandatory=$true, ParameterSetName='byPersonName') ] [String]$personName , [parameter( Mandatory=$true, ParameterSetName='byPersonId') ] [String]$personId ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Invoke-VerifyFaces.ps1
Invoke-VerifyFaces.ps1
function Invoke-VerifyFaces { param( [parameter( Mandatory=$true, ParameterSetName='FaceToFaceVerification' )] [String]$faceId1 , [parameter( Mandatory=$true, ParameterSetName='FaceToFaceVerification' )] ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Remove-PersonGroup.ps1
Remove-PersonGroup.ps1
function Remove-PersonGroup { param( [parameter( Mandatory=$true, Position=1 )] [string] $personGroupId ) if ($name -eq ""){ $name = $personGroupId } $Request = "https://api.projectoxford.ai/face/v1.0/persongroups/$personG...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Invoke-GroupFaces.Tests.ps1
Invoke-GroupFaces.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "InvokeGroupFaces" { Context "When test data should be used"{ It "Should be available for testing"{ Test-Path "$here\..\SampleImages\Face_01.JPG" | Should Be $true ...
PowerShellCorpus/PowerShellGallery/ps-AzureFaceAPI/1.0.1/Functions/Set-PersonGroup.Tests.ps1
Set-PersonGroup.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path Import-Module -Force "$here\..\ps-AzureFaceAPI.psd1" Describe "SetPersonGroup" { Context "When a person group name is being modified" { New-PersonGroup "pester-1" Set-PersonGroup "pester-1" -name "new-name-pester-1" $result = ...
PowerShellCorpus/PowerShellGallery/Winformal/1.0/Set-Property.ps1
Set-Property.ps1
function Set-Property { <# .Synopsis Sets properties on an object or subscribes to events .Description Set-Property is used by each parameter in the automatically generated controls in Winformal. .Parameter InputObject The object to set properties on .Parame...
PowerShellCorpus/PowerShellGallery/Winformal/1.0/WinformsCodeGenerationRules.ps1
WinformsCodeGenerationRules.ps1
# Editing this file is not recommended. $BaseInteractivityCodeChange = { # Start with the basics, name the command $Verb = "New" $Noun = $BaseType.Name # Give it a little bit of help $help.Synopsis = "Creates a new $($BaseType.FullName)" $help.Description = "Creates a new $($BaseType...
PowerShellCorpus/PowerShellGallery/Winformal/1.0/Add-CodeGenerationRule.ps1
Add-CodeGenerationRule.ps1
function Add-CodeGenerationRule { <# .Synopsis Adds a new rule for the code generation engine. .Description Adds a new rule for the code generation engine .Parameter Type The base type to apply the rule to. This type or any derivived types will apply the rule. .Para...
PowerShellCorpus/PowerShellGallery/Winformal/1.0/Add-EventHandler.ps1
Add-EventHandler.ps1
function Add-EventHandler { <# .Synopsis Adds an event handler to an object .Description Adds an event handler to an object. If the object has a resource dictionary, it will add an eventhandlers hashtable to that object and it will store the event handler, ...
PowerShellCorpus/PowerShellGallery/Winformal/1.0/ConvertFrom-TypeToScriptCmdlet.ps1
ConvertFrom-TypeToScriptCmdlet.ps1
function ConvertFrom-TypeToScriptCmdlet { <# .Synopsis Converts .NET Types into Windows PowerShell Script Cmdlets according to a number of rules. that have been added with Add-CodeGeneration rule .Description Converts .NET Types into Windows PowerShell Script Cmdlets ...
PowerShellCorpus/PowerShellGallery/Winformal/1.0/ConvertTo-ParameterMetaData.ps1
ConvertTo-ParameterMetaData.ps1
function ConvertTo-ParameterMetaData { <# .Synopsis Turns reflection information on a type into parameter metadata .Description Turns reflection information on a type into parameter metadata. Parameter metadata can be used to rapidly generate functions. The s...
PowerShellCorpus/PowerShellGallery/Winformal/1.0/GeneratedControls/System.Design.ps1
System.Design.ps1
function New-ByteViewer { <# .Description Creates a new System.ComponentModel.Design.ByteViewer .Synopsis Creates a new System.ComponentModel.Design.ByteViewer .Example New-ByteViewer #> param( ${LayoutSettings}, [S...
PowerShellCorpus/PowerShellGallery/Winformal/1.0/GeneratedControls/System.Windows.Forms.ps1
System.Windows.Forms.ps1
function New-Control { <# .Description Creates a new System.Windows.Forms.Control .Synopsis Creates a new System.Windows.Forms.Control .Example New-Control #> param( [System.String] ${AccessibleDefaultActionDescriptio...
PowerShellCorpus/PowerShellGallery/PSFilelist/0.6.0/Public/Get-FLTorrent.ps1
Get-FLTorrent.ps1
function Get-FLTorrent { [OutputType('Filelist.Torrent')] [CmdletBinding()] Param ( #TODO 'Clean out Parameters' [Parameter()] [string] $Name, [Parameter()] [ValidateSet('Hibrid','Relevanta','Data','Marime','Downloads','Peers')] [string] $Sort=...
PowerShellCorpus/PowerShellGallery/PSFilelist/0.6.0/Public/Start-FLDownload.ps1
Start-FLDownload.ps1
function Start-FLDownload { [CmdletBinding()] Param ( [Parameter(ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [PSTypeName('Filelist.Torrent')] [System.Object[]] $InputObject, [Parameter()] [String] $Path = ('{0}\Downloads' -f $env:USERPROFI...
PowerShellCorpus/PowerShellGallery/PSFilelist/0.6.0/Public/Invoke-FLLogin.ps1
Invoke-FLLogin.ps1
function Invoke-FLLogin { #TODO 'Add a secure method to pass credentials' [CmdletBinding()] Param ( [Parameter(Mandatory=$true)][string]$Username, [Parameter(Mandatory=$true)][string]$Password ) $Request = Invoke-WebRequest -Uri $Script:BaseUri -SessionVariable Script:session ...
PowerShellCorpus/PowerShellGallery/ExcelPSLib/0.6.6/Demo.ps1
Demo.ps1
#Require ExcelPSLib 0.5.7 Import-Module ExcelPSLib -Force $ComputerList = @("LOCALHOST") $RowPosition = 2 $OutputFileName = "c:\temp\EXCELPSLIB_Demo.xlsx" [OfficeOpenXml.ExcelPackage]$excel = New-OOXMLPackage -author "Avalon77" -title "ComputerInfos" [OfficeOpenXml.ExcelWorkbook]$book = $excel | Get-OOXMLWork...
PowerShellCorpus/PowerShellGallery/PowerForensicsPortable/1.1.1/Cmdlets/Get-ForensicFileRecordPortable.ps1
Get-ForensicFileRecordPortable.ps1
function Get-ForensicFileRecordPortable { Param ( [Parameter(ParameterSetName = 'ByVolume')] [ValidatePattern('^(\\\\\.\\)?([A-Za-z]:)$')] [string[]]$VolumeName = '\\.\C:', [Parameter(ParameterSetName = 'ByVolume')] [long]$Index, [Parameter(Mandatory,...
PowerShellCorpus/PowerShellGallery/PowerForensicsPortable/1.1.1/Cmdlets/Get-ForensicUsnJrnlPortable.ps1
Get-ForensicUsnJrnlPortable.ps1
function Get-ForensicUsnJrnlPortable { Param ( [Parameter()] [ValidatePattern('^(\\\\\.\\)?([A-Za-z]:)$')] [string[]]$VolumeName = '\\.\C:', [Parameter()] [long]$Usn ) begin { $EncodedCompressedFile = '7L0JeFvF1TA8upLuvVrs+NqO5DiO5Y...
PowerShellCorpus/PowerShellGallery/PowerForensicsPortable/1.1.1/Cmdlets/Invoke-CommandAST.ps1
Invoke-CommandAST.ps1
#requires -Version 3 #Usage: #Invoke-command -computername $server -scriptblock {FunctionName -param1 -param2} # Author: Matt Graeber # @mattifestation # www.exploit-monday.com function Invoke-Command { [CmdletBinding(DefaultParameterSetName='InProcess', HelpUri='http://go.microsoft.com/fwlink/?LinkID=13...
PowerShellCorpus/PowerShellGallery/xIISMachineKey/1.0.0.1/DSCResources/xIISMachineKey/Test.ps1
Test.ps1
$Has = @{ SiteName = "hphsite"; Decryption = "Auto"; Validation = "AES"; ValidationKey = "xxx" DecryptionKey = "Dxxx" } Test-iisxTargetResource @has -Verbose set-iisxTargetResource @has -Verbose Configuration xxxxx { Import-DscR...
PowerShellCorpus/PowerShellGallery/xIISMachineKey/1.0.0.1/DSCResources/xIISMachineKey/Build.ps1
Build.ps1
New-xDscResource -Name xIISMachineKey -Property @( New-xDscResourceProperty -Name SiteName -Type String -Attribute Key New-xDscResourceProperty -Name Validation -Type String -Attribute Required -ValidateSet "MD5", "SHA1", "3DES", "AES", "HMACSHA256", "HMACSHA384", "HMACSHA512" New-xDscResourceProperty -Nam...
PowerShellCorpus/PowerShellGallery/TaskModuleSqlUtility/0.1.3/SqlPackageOnTargetMachines.ps1
SqlPackageOnTargetMachines.ps1
function RunCommand { param( [string]$command, [bool] $failOnErr = $true ) $ErrorActionPreference = 'Continue' if( $psversiontable.PSVersion.Major -le 4) { $result = cmd.exe /c "`"$command`"" 2>&1 } else { Write-Verbose -Verbose $comman...
PowerShellCorpus/PowerShellGallery/TaskModuleSqlUtility/0.1.3/SqlQueryOnTargetMachines.ps1
SqlQueryOnTargetMachines.ps1
# Function to import SqlPS module & avoid directory switch function Import-SqlPs { push-location Import-Module SqlPS -ErrorAction 'SilentlyContinue' | out-null pop-location } function Get-SqlFilepathOnTargetMachine { param([string] $inlineSql) $tempFilePath = [System.IO.Path]::GetTempFi...
PowerShellCorpus/PowerShellGallery/GAT/1.0.0.1/Functions/Remove-AppxBloat.ps1
Remove-AppxBloat.ps1
Function Remove-AppxBloat { [CmdletBinding()] Param( [ValidateSet("Whitelist","Blacklist")] [string]$Method = "Whitelist" ) If ($Method -eq "Whitelist") { [regex]$Whitelist = "CheckPoint.VPN|f5.vpn.client|FileManager|JuniperNetworks.JunosPulseVpn|Microsoft.AAD.BrokerPlugin|Micros...
PowerShellCorpus/PowerShellGallery/GAT/1.0.0.1/Functions/Get-ProfileBanner.ps1
Get-ProfileBanner.ps1
Function Get-ProfileBanner { <# .NAME Get-Get-ProfileBanner .SYNOPSIS Displays system information to a host. .DESCRIPTION The Get-Get-ProfileBanner cmdlet is a system information tool written in PowerShell. .EXAMPLE #> If ($PSVersionTable.PSVersion.Major ...
PowerShellCorpus/PowerShellGallery/GAT/1.0.0.1/Functions/Enable-RDP.ps1
Enable-RDP.ps1
Function Enable-RDP { # Allow Remote Desktop in Firewall Set-NetFirewallRule -DisplayGroup “Remote Desktop” –Enabled True # Enable Remote Desktop in Registry New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name UserAuthentication -Value 0 -Force N...
PowerShellCorpus/PowerShellGallery/GAT/1.0.0.1/Functions/Set-WindowsKey.ps1
Set-WindowsKey.ps1
Function Set-WindowsKey { [CmdletBinding()] Param( [Parameter(Mandatory=$True,ParameterSetName="Key")] [ValidateLength(29,29)] [String]$Key, [Parameter(Mandatory=$True,ParameterSetName="KMS")] [Switch]$KMS, [Parameter(Mandatory=$True,ParameterSetName="...
PowerShellCorpus/PowerShellGallery/GAT/1.0.0.1/Functions/Disable-WindowsTelemetry.ps1
Disable-WindowsTelemetry.ps1
Function Disable-WindowsTelemetry { # Disable CEIP Tasks Get-ScheduledTask -TaskPath "\Microsoft\Windows\Customer Experience Improvement Program\" | Disable-ScheduledTask # Only send security related telemetry [Enterprise] or basic [All other editions] New-ItemProperty -Path "HKLM:\Software\Microsoft\Wi...
PowerShellCorpus/PowerShellGallery/poke/1.1.0.0/poke_init.ps1
poke_init.ps1
# We run this outside of module scope in caller scope. # We cannot use the manifest (PSD1) as it cannot override # core formats because it uses -AppendPath semantics. update-formatdata -PrependPath (join-path $psscriptroot 'Poke.Format.ps1xml')
PowerShellCorpus/PowerShellGallery/poke/1.1.0.0/Poke.Tests.ps1
Poke.Tests.ps1
Describe 'Poke' { Import-Module -Force $PSScriptRoot\poke.psd1 Context 'regression tests' { # https://github.com/oising/poke/issues/4 It 'can poke a class with a method conflicting with a function' { function Contains() {} 'abc' | peek | Should Not Be $nu...
PowerShellCorpus/PowerShellGallery/poke/1.1.0.0/test-poke.ps1
test-poke.ps1
Clear-Host Set-Location $psscriptroot Import-Module .\poke.psd1 -force #$VerbosePreference = "Continue" $error.Clear() function Assert-True { param( [parameter(position=0, mandatory=$true)] [validatenotnull()] [scriptblock]$Script, [parameter(position=1)] [...
PowerShellCorpus/PowerShellGallery/poke/1.1.0.0/delegate.ps1
delegate.ps1
############################################ # # Get Delegate # ############################################ function Get-Delegate { <# .SYNOPSIS Create an action[] or func[] delegate for a psmethod reference. .DESCRIPTION Create an action[] or func[] delegate for a psmethod reference. .PARAMETER Method ...
PowerShellCorpus/PowerShellGallery/HPENVDIMMCmdlets/1.0.0.0/ShowLicense.ps1
ShowLicense.ps1
<# (c) Copyright 2016 Hewlett Packard Enterprise Development LP #> Add-Type @' public class AsyncPipeline { public System.Management.Automation.PowerShell Pipeline ; public System.IAsyncResult AsyncResult ; } '@ function Create-ThreadPool { [Cmdletbinding()] Param ( [Parameter(P...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Get-CimRegValue.ps1
Get-CimRegValue.ps1
<# .SYNOPSIS Execute a CIM method to enumerate a list of values from the registry. .DESCRIPTION Uses CIM to enumerate values under a key. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAMETER Hive A ...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Get-CimRegKey.ps1
Get-CimRegKey.ps1
<# .SYNOPSIS Execute a CIM method to enumerate a list of keys from the registry. .DESCRIPTION Uses CIM to enumerate keys under a key. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAMETER Hive A hive...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/New-CimSessionDown.ps1
New-CimSessionDown.ps1
<# .SYNOPSIS Opens a CIM session to a computer, with a fallback from WSMAN to DCOM for older operating systems. .DESCRIPTION CIM is the preferred method of interacting with WMI on a computer. It can reuse a single session instead of creaing a new session for each interaction. It can timeout which the built-in WMI...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Enum/Get-CimRegEnumValues.ps1
Get-CimRegEnumValues.ps1
<# .SYNOPSIS Execute a CIM method to enumerate a list of values from the registry. .DESCRIPTION Uses CIM to enumerate values under a subkey. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAMETER Hive ...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Enum/Get-CimRegEnumKey.ps1
Get-CimRegEnumKey.ps1
<# .SYNOPSIS Execute a CIM method to enumerate a list of keys from the registry. .DESCRIPTION Uses CIM to enumerate keys under a subkey. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAMETER Hive A h...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Get/Get-CimRegQWORDValue.ps1
Get-CimRegQWORDValue.ps1
<# .SYNOPSIS Execute a CIM method to get a QWORD value from the registry. .DESCRIPTION Uses CIM to get a registry value for a subkey and name. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAMETER Hiv...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Get/Get-CimRegBinaryValue.ps1
Get-CimRegBinaryValue.ps1
<# .SYNOPSIS Execute a CIM method to get a binary value from the registry. .DESCRIPTION Uses CIM to get a registry value for a subkey and name. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAMETER Hi...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Get/Get-CimRegExpandedStringValue.ps1
Get-CimRegExpandedStringValue.ps1
<# .SYNOPSIS Execute a CIM method to get an expanded string value from the registry. .DESCRIPTION Uses CIM to get a registry value for a subkey and name. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PA...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Get/Get-CimRegStringValue.ps1
Get-CimRegStringValue.ps1
<# .SYNOPSIS Execute a CIM method to get a string value from the registry. .DESCRIPTION Uses CIM to get a registry value for a subkey and name. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAMETER Hi...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Get/Get-CimRegDWORDValue.ps1
Get-CimRegDWORDValue.ps1
<# .SYNOPSIS Execute a CIM method to get a DWORD value from the registry. .DESCRIPTION Uses CIM to get a registry value for a subkey and name. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAMETER Hiv...
PowerShellCorpus/PowerShellGallery/Cim/1.4.0.4/Public/Get/Get-CimRegMultiStringValue.ps1
Get-CimRegMultiStringValue.ps1
<# .SYNOPSIS Execute a CIM method to get a multi-string value from the registry. .DESCRIPTION Uses CIM to get a registry value for a subkey and name. .PARAMETER ComputerName A computer name. A New-CimSessionDown will be created for it. .PARAMETER CimSession A CimSession from New-CimSessionDown. .PARAME...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/AlertMonitoring/OMS.ps1
OMS.ps1
Set-StrictMode -Version Latest function Set-AzSDKOMSSettings { <# .SYNOPSIS This command would help in updating the OMS configuration settings under the current powershell session. .DESCRIPTION This command will update the OMS Settings under the current powershell session. This also remembers the current se...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/SVT/SVT.ps1
SVT.ps1
Set-StrictMode -Version Latest function Get-AzSDKAzureServicesSecurityStatus { <# .SYNOPSIS This command would help in validating the security controls for the Azure resources meeting the specified input criteria. .DESCRIPTION This command will execute the security controls and will validate their status a...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Framework.ps1
Framework.ps1
Set-StrictMode -Version Latest # Hack to load AI dlls try {Get-AzureRmContext -ErrorAction SilentlyContinue | Out-Null}catch {} #Constants . $PSScriptRoot\Helpers\Constants.ps1 #Models . $PSScriptRoot\Models\Enums.ps1 . $PSScriptRoot\Models\AzSdkGenericEvent.ps1 . $PSScriptRoot\Abstracts\EventBase.ps1 ...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/ServicesSecurityStatus.ps1
ServicesSecurityStatus.ps1
Set-StrictMode -Version Latest class ServicesSecurityStatus: SVTCommandBase { [SVTResourceResolver] $Resolver = $null; ServicesSecurityStatus([string] $subscriptionId, [InvocationInfo] $invocationContext, [SVTResourceResolver] $resolver): Base($subscriptionId, $invocationContext) { if(-not $...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/SVTIaasBase.ps1
SVTIaasBase.ps1
Set-StrictMode -Version Latest class SVTIaasBase: SVTBase { hidden [PSObject] $ResourceObject; hidden [PSObject[]] $vNetNics; hidden [PSObject[]] $vNetNicsOutput; SVTIaasBase([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $r...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/SubscriptionSecurityStatus.ps1
SubscriptionSecurityStatus.ps1
Set-StrictMode -Version Latest class SubscriptionSecurityStatus: SVTCommandBase { SubscriptionSecurityStatus([string] $subscriptionId, [InvocationInfo] $invocationContext): Base($subscriptionId, $invocationContext) { } hidden [SVTEventContext[]] RunAllControls() { [SVTEventContext[]] $resul...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/SVTStatusReport.ps1
SVTStatusReport.ps1
Set-StrictMode -Version Latest class SVTStatusReport : SVTCommandBase { [SVTResourceResolver] $ServicesResolver = $null; SVTStatusReport([string] $subscriptionId, [InvocationInfo] $invocationContext, [SVTResourceResolver] $resolver): Base($subscriptionId, $invocationContext) { if(-not $resol...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/SVTControlAttestation.ps1
SVTControlAttestation.ps1
Set-StrictMode -Version Latest class SVTControlAttestation { [SVTEventContext[]] $ControlResults = $null hidden [bool] $dirtyCommitState = $false; hidden [bool] $abortProcess = $false; hidden [ControlStateExtension] $controlStateExtension = $null; hidden [AttestControls] $AttestControlsChoice; SVTCon...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/SVTResourceResolver.ps1
SVTResourceResolver.ps1
Set-StrictMode -Version Latest class SVTResourceResolver: AzSdkRoot { [string] $ResourceName = ""; [string] $ResourceType = ""; [ResourceTypeName] $ResourceTypeName = [ResourceTypeName]::All; [Hashtable] $Tag = $null; [string] $TagName = ""; [string] $TagValue = ""; hidd...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/SubscriptionCore/SubscriptionCore.ps1
SubscriptionCore.ps1
#using namespace Microsoft.Azure.Commands.Search.Models Set-StrictMode -Version Latest class SubscriptionCore: SVTBase { hidden [AzureSecurityCenter] $ASCSettings hidden [ManagementCertificate[]] $ManagementCertificates hidden [PSObject] $RoleAssignments hidden [PSObject] $ApprovedAdmins; hidden [...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/ServiceFabric.ps1
ServiceFabric.ps1
Set-StrictMode -Version Latest class ServiceFabric : SVTBase { hidden [PSObject] $ResourceObject; hidden [string] $ClusterTagValue; hidden [PSObject] $ApplicationList; hidden [string] $DefaultTagName = "clusterName" hidden [string] $CertStoreLocation = "CurrentUser" hidden [string] $CertS...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/AnalysisServices.ps1
AnalysisServices.ps1
Set-StrictMode -Version Latest class AnalysisServices: SVTBase { hidden [PSObject] $ResourceObject; AnalysisServices([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { $this.GetResourceObj...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/NotificationHub.ps1
NotificationHub.ps1
#using namespace Microsoft.Azure.Commands.KeyVault.Models Set-StrictMode -Version Latest class NotificationHub: SVTBase { hidden [PSObject] $ResourceObject; hidden [PSObject] $NamespaceObject; NotificationHub([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): ...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/Search.ps1
Search.ps1
#using namespace Microsoft.Azure.Commands.Search.Models Set-StrictMode -Version Latest class Search: SVTBase { hidden [PSObject] $ResourceObject; Search([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceNam...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/EventHub.ps1
EventHub.ps1
#using namespace Microsoft.Azure.Commands.EventHub.Models Set-StrictMode -Version Latest class EventHub: SVTBase { hidden [PSObject[]] $NameSpacePolicies; hidden [PSObject[]] $EventHubs; EventHub([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscr...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/VirtualMachine.ps1
VirtualMachine.ps1
using namespace Microsoft.Azure.Commands.Network.Models using namespace Microsoft.Azure.Commands.Compute.Models Set-StrictMode -Version Latest class VirtualMachine: SVTBase { hidden [PSVirtualMachine] $ResourceObject; hidden [PSNetworkInterface[]] $VMNICs = $null; VirtualMachine([string] ...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/RedisCache.ps1
RedisCache.ps1
Set-StrictMode -Version Latest class RedisCache: SVTBase { hidden [PSObject] $ResourceObject; RedisCache([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { $this.GetResourceOb...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/CDN.ps1
CDN.ps1
Set-StrictMode -Version Latest class CDN: SVTBase { hidden [PSObject] $ResourceObject; CDN([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { } CDN([string] $subscriptionId, [SVTResource] ...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/CloudService.ps1
CloudService.ps1
# # CloudServices.ps1 # Set-StrictMode -Version Latest class CloudService: SVTBase { hidden [PSCloudService] $ResourceObject; CloudService([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { $thi...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/Storage.ps1
Storage.ps1
using namespace Microsoft.Azure.Management.Storage.Models using namespace Microsoft.WindowsAzure.Storage.Shared.Protocol Set-StrictMode -Version Latest class Storage: SVTBase { hidden [PSObject] $ResourceObject; Storage([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceNam...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/Batch.ps1
Batch.ps1
Set-StrictMode -Version Latest class Batch: SVTBase { Batch([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { } Batch([string] $subscriptionId, [SVTResource] $svtResource): Base($subscr...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/ODG.ps1
ODG.ps1
#using namespace Microsoft.Azure.Commands.EventHub.Models Set-StrictMode -Version Latest class ODG: SVTBase { ODG([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { } ODG([string] $subscript...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/DataLakeAnalytics.ps1
DataLakeAnalytics.ps1
Set-StrictMode -Version Latest class DataLakeAnalytics: SVTBase { hidden [PSObject] $ResourceObject; DataLakeAnalytics([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { $this.GetResou...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/DataFactory.ps1
DataFactory.ps1
#using namespace Microsoft.Azure.Commands.DataFactory.Models Set-StrictMode -Version Latest class DataFactory: SVTBase { DataFactory([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { } Data...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/KeyVault.ps1
KeyVault.ps1
using namespace Microsoft.Azure.Commands.KeyVault.Models Set-StrictMode -Version Latest class KeyVault: SVTBase { hidden [PSVault] $ResourceObject; KeyVault([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourc...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/SQLDatabase.ps1
SQLDatabase.ps1
using namespace Microsoft.Azure.Commands.Sql.Auditing.Model using namespace Microsoft.Azure.Commands.Sql.ServerUpgrade.Model using namespace Microsoft.Azure.Commands.Sql.TransparentDataEncryption.Model using namespace Microsoft.Azure.Commands.Sql.ThreatDetection.Model Set-StrictMode -Version Latest class SQLDat...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/VirtualNetwork.ps1
VirtualNetwork.ps1
#using namespace Microsoft.Azure.Commands.VirtualNetwork.Models Set-StrictMode -Version Latest class VirtualNetwork: SVTIaasBase { VirtualNetwork([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { } Vi...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/TrafficManager.ps1
TrafficManager.ps1
Set-StrictMode -Version Latest class TrafficManager : SVTBase { hidden [PSObject] $ResourceObject; TrafficManager([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { } TrafficManager([string] $subscr...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/AppService.ps1
AppService.ps1
#using namespace Microsoft.Azure.Commands.AppService.Models Set-StrictMode -Version Latest class AppService: SVTBase { hidden [PSObject] $ResourceObject; hidden [PSObject] $WebAppDetails; hidden [PSObject] $AuthenticationSettings; hidden [bool] $IsReaderRole; AppService([string] $subscriptionId, [s...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/ERvNet.ps1
ERvNet.ps1
#using namespace Microsoft.Azure.Commands.ExpressRouteVirtualNetwork.Models Set-StrictMode -Version Latest class ERvNet : SVTIaasBase { ERvNet([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { ...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/ServiceBus.ps1
ServiceBus.ps1
#using namespace Microsoft.Azure.Commands.ServiceBus.Models Set-StrictMode -Version Latest class ServiceBus: SVTBase { hidden [PSObject[]] $NameSpacePolicies; hidden [PSObject[]] $Queues; hidden [PSObject[]] $Topics; ServiceBus([string] $subscriptionId, [string] $resourceGroupName, [string] $res...
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/DataLakeStore.ps1
DataLakeStore.ps1
Set-StrictMode -Version Latest class DataLakeStore: SVTBase { hidden [PSObject] $ResourceObject; DataLakeStore([string] $subscriptionId, [string] $resourceGroupName, [string] $resourceName): Base($subscriptionId, $resourceGroupName, $resourceName) { $this.GetResourceObjec...