win_firewall- Change req check from wmf version to cmdlets presence (#64998)

pull/65092/head
Shachaf92 6 years ago committed by Jordan Borean
parent f5133bec22
commit 96a422a6fc

@ -0,0 +1,2 @@
minor_changes:
- "win_firewall- Change req check from wmf version to cmdlets presence - https://github.com/ansible/ansible/issues/63003"

@ -20,8 +20,12 @@ $result = @{
state = $state
}
if ($PSVersionTable.PSVersion -lt [Version]"5.0") {
Fail-Json $result "win_firewall requires Windows Management Framework 5 or higher."
try {
get-command Get-NetFirewallProfile > $null
get-command Set-NetFirewallProfile > $null
}
catch {
Fail-Json $result "win_firewall requires Get-NetFirewallProfile and Set-NetFirewallProfile Cmdlets."
}
Try {

Loading…
Cancel
Save