From 4a1684c38e3c56bf08af68d81b9b96788874c4c7 Mon Sep 17 00:00:00 2001 From: edmondshtogu Date: Mon, 3 Jun 2019 11:44:30 +0200 Subject: [PATCH] check if rules exist are failing. the check shall be like ~ Get-NetFirewallRule -DisplayName eShopOnContainers-* -ErrorAction Stop --- cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 b/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 index 271b6a77d..32df7a63c 100644 --- a/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 +++ b/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 @@ -17,10 +17,10 @@ exit } try { - Get-NetFirewallRule -DisplayName EshopDocker -ErrorAction Stop + Get-NetFirewallRule -DisplayName eShopOnContainers-* -ErrorAction Stop Write-Host "Rule found" } catch [Exception] { New-NetFirewallRule -DisplayName eShopOnContainers-Inbound -Confirm -Description "eShopOnContainers Inbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound New-NetFirewallRule -DisplayName eShopOnContainers-Outbound -Confirm -Description "eShopOnContainers Outbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound -} \ No newline at end of file +}