@ -24,7 +24,7 @@ function getFirewallRule ($fwsettings) {
try {
try {
#$output = Get-NetFirewallRule -name $($fwsettings.name);
#$output = Get-NetFirewallRule -name $($fwsettings.name);
$rawoutput = @ ( netsh advfirewall firewall show rule name = $ ($fwsettings . Name ) )
$rawoutput = @ ( netsh advfirewall firewall show rule name = " $ ($fwsettings . Name ) " )
if ( ! ( $rawoutput -eq 'No rules match the specified criteria.' ) ) {
if ( ! ( $rawoutput -eq 'No rules match the specified criteria.' ) ) {
$rawoutput | Where { $_ -match '^([^:]+):\s*(\S.*)$' } | Foreach -Begin {
$rawoutput | Where { $_ -match '^([^:]+):\s*(\S.*)$' } | Foreach -Begin {
$FirstRun = $true ;
$FirstRun = $true ;
@ -123,8 +123,9 @@ function createFireWallRule ($fwsettings) {
$execString + = " " ;
$execString + = " " ;
$execString + = $key ;
$execString + = $key ;
$execString + = " = " ;
$execString + = " = " ;
$execString + = '"' ;
$execString + = $fwsetting . value ;
$execString + = $fwsetting . value ;
#$execString+="'" ;
$execString + = '"' ;
} ;
} ;
try {
try {
#$msg+=@($execString);
#$msg+=@($execString);
@ -152,7 +153,7 @@ function createFireWallRule ($fwsettings) {
function removeFireWallRule ( $fwsettings ) {
function removeFireWallRule ( $fwsettings ) {
$msg = @ ( )
$msg = @ ( )
try {
try {
$rawoutput = @ ( netsh advfirewall firewall delete rule name = $ ($fwsettings . name ) )
$rawoutput = @ ( netsh advfirewall firewall delete rule name = " $ ($fwsettings . name ) " )
$rawoutput | Where { $_ -match '^([^:]+):\s*(\S.*)$' } | Foreach -Begin {
$rawoutput | Where { $_ -match '^([^:]+):\s*(\S.*)$' } | Foreach -Begin {
$FirstRun = $true ;
$FirstRun = $true ;
$HashProps = @ { } ;
$HashProps = @ { } ;