You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write-Host"Check your input! Invalid Port-Range... (-StartPort can't be lower than -EndPort)"-ForegroundColor Red
85
-
exit
86
-
}
87
80
88
-
$PortRange= ($EndPort-$StartPort)
89
-
90
-
# Port list can be updated from IANA.org with the parameter "-UpdateListFromIANA
81
+
# Port list can be updated from IANA.org with the parameter "-UpdateListFromIANA
91
82
if($UpdateListFromIANA)
92
83
{
93
84
try
@@ -96,7 +87,10 @@ Begin{
96
87
97
88
[xml]$New_XML_PortList=Invoke-WebRequest-Uri $IANA_PortList_WebUri# Download latest xml-file from IANA
98
89
99
-
Remove-Item$XML_PortList_Path-Force -ErrorAction SilentlyContinue # Don`t show errors if there is no old file
90
+
if([System.IO.File]::Exists($XML_PortList_Path))
91
+
{
92
+
Remove-Item-Path $XML_PortList_Path
93
+
}
100
94
101
95
$New_XML_PortList.Save($XML_PortList_Path) # Save xml-file
102
96
@@ -106,7 +100,7 @@ Begin{
106
100
{
107
101
$ErrorMsg=$_.Exception.Message
108
102
109
-
Write-Host"Update Service Name and Transport Protocol Port Number Registry from IANA failed with the follwing error message: $ErrorMsg"-ForegroundColor Red
103
+
Write-Host"Update Service Name and Transport Protocol Port Number Registry from IANA.org failed with the follwing error message: $ErrorMsg"-ForegroundColor Red
0 commit comments