我在从特定的参数集中获取参数时遇到了一些问题。我已经通过获取所有参数并使用$parDetails.Name.Contains("FileAttachment")
作为if
语句解决了这个问题。
相反,我想要的是从特定的参数集中获取参数。
有没有人能帮我一下?下面是我目前使用的代码。
$CommandName = $PSCmdlet.MyInvocation.InvocationName
$ParameterList = (Get-Command -Name $CommandName).Parameter
foreach ($key in $ParameterList.keys) {
Write-Verbose "Starting loop for $key"
$parDetails = Get-Variable -Name $key
}
https://stackoverflow.com/questions/50936256
复制相似问题