Powershell:不能使用-pipelinevariable和get-netfirewallrule(动态参数)

时间:2018-03-17 16:21:46

标签: powershell variables firewall pipeline dynamicparameters

为什么我不能将-pipeline变量与get-netfirewallrule一起使用?

PS C:\> Get-NetFirewallRule -PipelineVariable myfirewall | Get-NetFirewallPortFilter

Get-NetFirewallRule : Cannot retrieve the dynamic parameters for the cmdlet. Object reference not set to an instance of an object.
At line:1 char:1
+ Get-NetFirewallRule -PipelineVariable firewall | Get-NetFirewallPortF ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-NetFirewallRule], ParameterBindingException
    + FullyQualifiedErrorId : GetDynamicParametersException,Get-NetFirewallRule

0 个答案:

没有答案