major update to override Write-Output func

This commit is contained in:
2023-10-05 13:11:38 -04:00
parent 31a06a9206
commit bbb4884818
52 changed files with 377 additions and 378 deletions
+8 -8
View File
@@ -20,7 +20,7 @@ If ( IsWindowsVersion -ge "6.1" )
## Check to make sure the ZeroTierOneService has started
## We'll only loop through this for a few seconds before failing
LogMsg "Attempting to start the ZeroTierOneService service..."
Write-Output "Attempting to start the ZeroTierOneService service..."
For ( $i = 1 ; $i -le 5 ; $i++ )
{
## Check to see if the service is running
@@ -37,7 +37,7 @@ If ( IsWindowsVersion -ge "6.1" )
## If the service is running, break the loop
Else
{
LogMsg " ZeroTierOneService service is started"
Write-Output " ZeroTierOneService service is started"
$ServiceRunning = $true ; break
}
}
@@ -54,27 +54,27 @@ If ( IsWindowsVersion -ge "6.1" )
If ( Test-Path "${ZTcli}" )
{
## Join the network, if $ZTcli exists
LogMsg "Joining ZeroTier network ${JoinNetwork}"
Write-Output "Joining ZeroTier network ${JoinNetwork}"
Try { Start-Process $ZTcli -ArgumentList "join ${JoinNetwork}" -Wait }
Catch { LogErr $_.Exception.Message }
}
Else { LogMsg "Could not find ""${ZTcli}""" }
Else { Write-Output "Could not find ""${ZTcli}""" }
}
## If the service still isn't running, just error out
Else { LogMsg " ZeroTierOneService could not be started in a timely fashion" }
Else { Write-Output " ZeroTierOneService could not be started in a timely fashion" }
}
Else { LogMsg "A ZeroTier network ID was not specified, will not join any network" }
Else { Write-Output "A ZeroTier network ID was not specified, will not join any network" }
## Remove the ZeroTier One Start Menu shortcut
$ShortcutPath = "${ProgramData}\Microsoft\Windows\Start Menu\Programs\ZeroTier One.lnk"
If ( Test-Path $ShortcutPath )
{
LogMsg "Deleting Start Menu shortcut from ""${ShortcutPath}"""
Write-Output "Deleting Start Menu shortcut from ""${ShortcutPath}"""
Try { Remove-Item $ShortcutPath -Force }
Catch { LogErr $_.Exception.Message }
}
}
Else { LogMsg "ZeroTier can only be installed on Windows 7 or higher operating systems" }
Else { Write-Output "ZeroTier can only be installed on Windows 7 or higher operating systems" }