function Test-ParameterSet
{
[CmdletBinding(DefaultParameterSetName=’NonCredential’)]
param
(
$id,
function Test-ParameterSet
{
[CmdletBinding(DefaultParameterSetName=’NonCredential’)]
param
(
$id,
[Parameter(ParameterSetName=’LocalOnly’, Mandatory=$false)]
$LocalAction,
[Parameter(ParameterSetName=’Credential’, Mandatory=$true)]
[Parameter(ParameterSetName=’NonCredential’, Mandatory=$false)]
$ComputerName,
[Parameter(ParameterSetName=’Credential’, Mandatory=$false)]
$Credential
)
$PSCmdlet.ParameterSetName
$PSBoundParameters
if ($PSBoundParameters.ContainsKey(‘ComputerName’))
{
Write-Warning ‘Remote Call!’
}
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。