major change to override Write-Error func

This commit is contained in:
2023-10-05 13:17:18 -04:00
parent bbb4884818
commit 5f4b4565de
42 changed files with 114 additions and 114 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ If ( IsWindowsVersion -ge "6.1" )
{
## Attempt to stop/start the service
Try { Restart-Service -Name ZeroTierOneService -Force }
Catch { LogErr $_.Exception.Message }
Catch { Write-Error $_.Exception.Message }
## Wait a few seconds before checking again
Start-Sleep -Seconds 5
@@ -56,7 +56,7 @@ If ( IsWindowsVersion -ge "6.1" )
## Join the network, if $ZTcli exists
Write-Output "Joining ZeroTier network ${JoinNetwork}"
Try { Start-Process $ZTcli -ArgumentList "join ${JoinNetwork}" -Wait }
Catch { LogErr $_.Exception.Message }
Catch { Write-Error $_.Exception.Message }
}
Else { Write-Output "Could not find ""${ZTcli}""" }
}
@@ -73,7 +73,7 @@ If ( IsWindowsVersion -ge "6.1" )
{
Write-Output "Deleting Start Menu shortcut from ""${ShortcutPath}"""
Try { Remove-Item $ShortcutPath -Force }
Catch { LogErr $_.Exception.Message }
Catch { Write-Error $_.Exception.Message }
}
}