mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
Remove TypeData command was causing error when its called in the same session which was resulting into windows_firewall_rule was not working correctly locally when we have more than one describe block for windows_firewall_rule resource
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
parent
f479aa644c
commit
95656f97da
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ module Inspec::Resources
|
||||||
# @see https://github.com/chef/chef/blob/master/lib/chef/resource/windows_firewall_rule.rb
|
# @see https://github.com/chef/chef/blob/master/lib/chef/resource/windows_firewall_rule.rb
|
||||||
def load_firewall_state(rule_name)
|
def load_firewall_state(rule_name)
|
||||||
<<-EOH
|
<<-EOH
|
||||||
Remove-TypeData System.Array # workaround for PS bug here: https://bit.ly/2SRMQ8M
|
Get-TypeData -TypeName System.Array | Remove-TypeData # workaround for PS bug here: https://bit.ly/2SRMQ8M
|
||||||
$rule = Get-NetFirewallRule -Name "#{rule_name}"
|
$rule = Get-NetFirewallRule -Name "#{rule_name}"
|
||||||
$addressFilter = $rule | Get-NetFirewallAddressFilter
|
$addressFilter = $rule | Get-NetFirewallAddressFilter
|
||||||
$portFilter = $rule | Get-NetFirewallPortFilter
|
$portFilter = $rule | Get-NetFirewallPortFilter
|
||||||
|
|
Loading…
Reference in a new issue