win_firewall- Change req check from wmf version to cmdlets presence (#64998)
This commit is contained in:
parent
f5133bec22
commit
96a422a6fc
2 changed files with 8 additions and 2 deletions
|
@ -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…
Reference in a new issue