fix: win10 - Add exception handling for 'Profiles:' textual output key name mismatch.

In win10 (and pribably win8x also):

The output of 'show rule' key includes the line "Profiles:<TAB>Public,Private".
Yet your script expects the key name printed out to be "Profile:<TAB>value".

This commit added the necessary exception handling to avoid flagging 'different=true' under the false circumstance. The key name to SET a firewall rule is still "profile=" and not "profiles=".

There is coming up another commit to fix the value handling for win10/win8. Which is another (different) error with the profile: key.
reviewable/pr18780/r1
Dreamcat4 9 years ago
parent 2654789af7
commit 6c5a4a14ef

@ -75,6 +75,8 @@ function getFirewallRule ($fwsettings) {
$donothing=$false
} elseif ((($fwsetting.Key -eq 'Name') -or ($fwsetting.Key -eq 'DisplayName')) -and ($output."Rule Name" -eq $fwsettings.$($fwsetting.Key))) {
$donothing=$false
} elseif (($fwsetting.Key -eq 'Profile') -and ($output."Profiles" -eq $fwsettings.$($fwsetting.Key))) {
$donothing=$false
} else {
$diff=$true;
$difference+=@($fwsettings.$($fwsetting.Key));

Loading…
Cancel
Save