Steps to reproduce
function TestEnableNetFirewallRule() {
[CmdLetBinding(SupportsShouldProcess=$true)]
param ([string]$DisplayGroup)
Enable-NetFirewallRule -DisplayGroup $DisplayGroup
}
TestEnableNetFirewallRule -DisplayGroup "Remote Desktop" -WhatIf
Expected behavior
The firewall rule is not enabled, and the same output as when calling Enable-NetFirewallRule -DisplayGroup "Remote Desktop" -WhatIf:
What if: Enable-NetFirewallRule DisplayName: RemoteDesktop-Shadow-In-TCP
What if: Enable-NetFirewallRule DisplayName: RemoteDesktop-UserMode-In-UDP
What if: Enable-NetFirewallRule DisplayName: RemoteDesktop-UserMode-In-TCP
Actual behavior
No output, and the firewall rule for Remote Desktop is enabled
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.251
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.251
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Steps to reproduce
Expected behavior
The firewall rule is not enabled, and the same output as when calling
Enable-NetFirewallRule -DisplayGroup "Remote Desktop" -WhatIf:Actual behavior
No output, and the firewall rule for Remote Desktop is enabled
Environment data