Remove TypeData command was causing error when its called in the same session which was resulting into windows_firewall resource was not working correctly locally when we have more than one describe block.

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasu1105 2021-10-21 19:28:15 +05:30
parent c391ca349b
commit e78f58fa5a

View file

@ -77,7 +77,7 @@ module Inspec::Resources
def load_firewall_profile(profile_name)
<<-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
$profile = Get-NetFirewallProfile -Name "#{profile_name}"
$count = @($profile | Get-NetFirewallRule).Count
([PSCustomObject]@{