major change to override Write-Error func
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user