#4.2
Configuration TestScript  
{ 
    Node localhost 
    { 
        Script SetFirewall 
        { 
            GetScript  = { 
                $Result = @{ 
                    GetScript  = $GetScript 
                    SetScript  = $SetScript 
                    TestScript = $TestScript 
                    Result     = '' 
                } 
                $RuleName = 'WINRM-HTTP-In-TCP-NoScope' 
                if ((Get-NetFirewallRule $RuleName).Enabled)
                { 
                    $Result.Result = 'OK' 
                }
                else
                { 
                    $Result.Result = 'KO' 
                } 
                $Result 
            } 
            SetScript  = { 
                Get-NetFirewallRule WINRM-HTTP-In-TCP-NoScope | `
                    Set-NetFirewallRule -Enabled True 
            } 
            TestScript = { 
        (Get-NetFirewallRule WINRM-HTTP-In-TCP-NoScope).Enabled 
            } 
        } 
    } 
} 
 
TestScript
