Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Testing the powershell overload mechanism.
- function overload
- ( [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNI8')][byte]$i8
- , [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNI16')][int16]$i16
- , [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNI32')][int32]$i32
- , [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNI64')][int64]$i64
- , [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNI')][bigint]$ii
- , [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNF')][double]$f
- , [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNB')][bool]$b
- , [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNS')][string]$s
- #, [parameter(Mandatory = 1, Position = 0, ParameterSetName='PSNV')]$v
- )
- { Write-Host ($PSCmdlet.ParameterSetName)}
- Write-Host Byte
- overload ([byte]1)
- Write-Host Int
- overload 1
- Write-Host Float
- overload 1.0
- # # #
- # Output
- # # #
- <#
- Byte
- PSNI8
- Int
- PSNI32
- Float
- PSNF
- #>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement