Skip to content

Instantly share code, notes, and snippets.

@gerane
Last active May 12, 2016 17:14
Show Gist options
  • Save gerane/8c91633ce89e8d8555a2cd596c8a45c0 to your computer and use it in GitHub Desktop.
Save gerane/8c91633ce89e8d8555a2cd596c8a45c0 to your computer and use it in GitHub Desktop.
function Test-ParameterSet
{
[CmdletBinding(DefaultParameterSetName = 'Default')]
[OutputType([boolean], ParameterSetName = 'Test')]
[OutputType([PSObject], ParameterSetName = 'Default')]
param
(
[parameter(Mandatory = $true)]
[System.String]$Param1,
[parameter(Mandatory = $true)]
[System.String]$Param2,
[System.String]$Param3,
[System.UInt32]$Param4,
[Parameter(ParameterSetName = 'Test')]
[switch]$Test
)
$PSCmdlet.ParameterSetName
}
function Test-ParameterSet
{
[CmdletBinding(DefaultParameterSetName = 'Default')]
[OutputType([boolean], ParameterSetName = 'Test')]
[OutputType([PSObject], ParameterSetName = 'Default')]
[OutputType([psobject])]
param
(
[parameter(Mandatory = $true)]
[System.String]$Param1,
[parameter(Mandatory = $true)]
[System.String]$Param2,
[System.String]$Param3,
[System.UInt32]$Param4,
[Parameter(ParameterSetName = 'Test')]
[switch]$Test
)
$PSCmdlet.ParameterSetName
}
function Test-ParameterSet
{
[CmdletBinding()]
[OutputType([boolean], ParameterSetName = 'Test')]
[OutputType([psobject])]
param
(
[parameter(Mandatory = $true)]
[System.String]$Param1,
[parameter(Mandatory = $true)]
[System.String]$Param2,
[System.String]$Param3,
[System.UInt32]$Param4,
[Parameter(ParameterSetName = 'Test')]
[switch]$Test
)
$PSCmdlet.ParameterSetName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment