This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MagicNumber | |
| { | |
| hidden [int] $_value | |
| MagicNumber([int]$value) | |
| { | |
| $this._value = $value | |
| } | |
| # ECMA-335 I.10.3.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ConvertTo-List | |
| { | |
| param( | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
| [object[]]$InputObject | |
| ) | |
| begin { | |
| $list = [System.Collections.Generic.List[object]]::new() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Fake-Progress | |
| { | |
| $PSDefaultParameterValues['Write-Progress:Activity']='Making stuff up' | |
| Write-Progress -Status 'Starting out' -PercentComplete 5 | |
| 10..45|%{ | |
| Write-Progress -Status 'Doing stuff' -PercentComplete $_ | |
| Start-Sleep -Milliseconds 100 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-XmlFileTreeAppend | |
| { | |
| param( | |
| [Parameter(ParameterSetName='Path', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] | |
| [string[]] | |
| ${Path}, | |
| [Parameter(ParameterSetName='LiteralPath', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] | |
| [Alias('PSPath')] | |
| [string[]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Invoke-RegexTerror | |
| { | |
| [CmdletBinding(DefaultParameterSetName = 'ToBeOrNotToBe')] | |
| param( | |
| [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)] | |
| [int]$Count, | |
| [Parameter(ParameterSetName = 'ToBeOrNotToBe')] | |
| [switch]$Shakespeare, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-ADLockedOutUser { | |
| [CmdletBinding(DefaultParameterSetName = 'MultiDC')] | |
| param( | |
| [Parameter(Mandatory = $false, ParameterSetName = 'MultiDC')] | |
| [string[]]$DCFilter = @('*'), | |
| [Parameter(Mandatory = $true, ParameterSetName = 'PDCOnly')] | |
| [switch]$PDCOnly | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using namespace System.Net.Sockets | |
| using namespace System.Net.Security | |
| using namespace System.Security.Cryptography.X509Certificates | |
| function ConvertFrom-X509Certificate { | |
| param( | |
| [Parameter(ValueFromPipeline)] | |
| [X509Certificate2]$Certificate | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LCG | |
| { | |
| hidden [long] | |
| $factor = 1140671485 | |
| hidden [long] | |
| $offset = 12820163 | |
| hidden [long] | |
| $modulus = 16777216 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-WebExceptionBody | |
| { | |
| param( | |
| [int]$Last | |
| ) | |
| if(-not $PSBoundParameters.ContainsKey('Last')){ | |
| $Last = 1 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using namespace System | |
| using namespace System.Net | |
| using namespace System.Text | |
| using namespace System.IO | |
| class Test | |
| { | |
| # Specify the URL to receive the request. | |
| static Run([string[]]$arguments) | |
| { |