Skip to content

Instantly share code, notes, and snippets.

@wise-io
Last active April 22, 2024 13:14
Show Gist options
  • Save wise-io/9fd31d8203343e99844cbb9967f30298 to your computer and use it in GitHub Desktop.
Save wise-io/9fd31d8203343e99844cbb9967f30298 to your computer and use it in GitHub Desktop.
PowerShell script to uninstall ZeroTier One silently
# Removes ZeroTier One
$Paths = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
$ZeroTierOne = Get-ChildItem -Path $Paths | Get-ItemProperty | Where-Object { $_.DisplayName -like 'ZeroTier One' } | Select-Object
$VirtualNetworkPort = Get-ChildItem -Path $Paths | Get-ItemProperty | Where-Object { $_.DisplayName -like 'ZeroTier One Virtual Network Port' } | Select-Object
if ($ZeroTierOne) {
Write-Output 'Uninstalling ZeroTier One...'
foreach ($Ver in $ZeroTierOne) {
$Uninst = $Ver.UninstallString
cmd /c $Uninst /qn
}
}
if ($VirtualNetworkPort) {
Write-Output 'Uninstalling ZeroTier Virtual Network Port...'
foreach ($Ver in $VirtualNetworkPort) {
$Uninst = $Ver.UninstallString
cmd /c $Uninst /qn
}
}
Write-Output 'Uninstall complete. Restart recommended before reinstall.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment