[CmdletBinding()]
Param(
[string][Alias("sL")] $setList,
[string][Alias("aS")] $applySet,
[string][Alias("cS")] $conformSet,
[Parameter(ValueFromRemainingArguments = $true)][Object[]]$extraParameters = @()
)
Write-Host "sL: $setList"
Write-Host "aS: $applySet"
Write-Host "cS: $conformSet"
Write-Host "X: $extraParameters"
和命令行 ... -file“Test-Arguments.ps1”-set:Set Junk 即使未提供名称,垃圾也会被分配给$ applySet。我是否也误解了这个功能?