fix comment formatting
This commit is contained in:
+11
-11
@@ -1,4 +1,4 @@
|
||||
## List all possible TeamViewer installation paths here.
|
||||
# List all possible TeamViewer installation paths here.
|
||||
$UninstallerPaths = @(
|
||||
"${Env:ProgramFiles}\TeamViewer\Version6\uninstall.exe",
|
||||
"${Env:ProgramFiles(x86)}\TeamViewer\Version6\uninstall.exe",
|
||||
@@ -14,7 +14,7 @@ $UninstallerPaths = @(
|
||||
"${Env:ProgramFiles(x86)}\Take Control Viewer\uninstall.exe"
|
||||
)
|
||||
|
||||
## List all known registry keys
|
||||
# List all known registry keys
|
||||
$RegKeys = @(
|
||||
"HKLM\SOFTWARE\TeamViewer",
|
||||
"HKLM\SOFTWARE\WOW6432Node\TeamViewer",
|
||||
@@ -23,7 +23,7 @@ $RegKeys = @(
|
||||
"HKCU\SOFTWARE\Wow6432Node\TeamViewer"
|
||||
)
|
||||
|
||||
## Find the most likely path to the TeamViewer uninstaller
|
||||
# Find the most likely path to the TeamViewer uninstaller
|
||||
If ( Test-Path "${Env:ProgramFiles(x86)}" )
|
||||
{
|
||||
$INSTALLDIR = $(Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\TeamViewer").InstallationDirectory
|
||||
@@ -34,33 +34,33 @@ Else
|
||||
$INSTALLDIR = $(Get-ItemProperty -Path "HKLM:\SOFTWARE\TeamViewer").InstallationDirectory
|
||||
}
|
||||
|
||||
## Kill all running instances of TeamViewer
|
||||
Get-Process | Where { $_.Name -like "*TeamViewer*" } | Stop-Process
|
||||
# Kill all running instances of TeamViewer
|
||||
Get-Process | Where { $_.Name -like "*TeamViewer*" } | Stop-Process -Force
|
||||
|
||||
If ( Test-Path "${INSTALLDIR}\uninstall.exe" )
|
||||
{ Start-Process "${INSTALLDIR}\uninstall.exe" -ArgumentList "/S" -Wait }
|
||||
|
||||
## Loop through each path in $UninstallerPaths and test if each one exists.
|
||||
## If a path exists, silently run the uninstaller and then delete the directory.
|
||||
# Loop through each path in $UninstallerPaths and test if each one exists.
|
||||
# If a path exists, silently run the uninstaller and then delete the directory.
|
||||
Foreach ($uninstaller in $UninstallerPaths)
|
||||
{
|
||||
If ( Test-Path "${uninstaller}" )
|
||||
{
|
||||
## Run the uninstaller
|
||||
# Run the uninstaller
|
||||
Start-Process "${uninstaller}" -ArgumentList "/S" -Wait
|
||||
|
||||
## Remove the directory
|
||||
# Remove the directory
|
||||
$dirname = $(Get-Item $uninstaller).Directory.FullName
|
||||
Remove-Item "${dirname}" -Recurse -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
## Remove each registry key in $RegKeys
|
||||
# Remove each registry key in $RegKeys
|
||||
Foreach ($key in $RegKeys)
|
||||
{
|
||||
If ( Test-Path $key ) { Remove-Item $key -Recurse }
|
||||
}
|
||||
|
||||
## Remove the TeamViewer service
|
||||
# Remove the TeamViewer service
|
||||
Start-Process "sc.exe" -ArgumentList "delete TeamViewer" -Wait
|
||||
Start-Process "sc.exe" -ArgumentList "delete TeamViewer_Service" -Wait
|
||||
Reference in New Issue
Block a user