Skip to content

Instantly share code, notes, and snippets.

@ZJPat
Created June 8, 2016 04:11
Show Gist options
  • Save ZJPat/3e8fd551a17b6086fc47357467f1f0eb to your computer and use it in GitHub Desktop.
Save ZJPat/3e8fd551a17b6086fc47357467f1f0eb to your computer and use it in GitHub Desktop.
If (${env:ProgramFiles(x86)}) {
$uninstallpaths = Get-ChildItem -Path ${env:ProgramFiles(x86)}, $env:ProgramFiles -Recurse -Filter uninstall.exe | Where-Object {$_.fullname -like "*teamv*"} | Select-Object -expandproperty fullname
}
Else {$uninstallpaths = Get-ChildItem -Path $env:ProgramFiles -Recurse -Filter uninstall.exe | Where-Object {$_.fullname -like "*teamv*"} | Select-Object -expandproperty fullname}
If ($uninstallpaths) {
foreach ($uninstallpath in $uninstallpaths) {
Start-Process cmd -ArgumentList "/C `"$uninstallpath`" /S" -Wait
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment