Skip to content

Instantly share code, notes, and snippets.

@tdewin
Created August 30, 2018 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdewin/1b4d991bdbd4b50aecf424fc623ad47f to your computer and use it in GitHub Desktop.
Save tdewin/1b4d991bdbd4b50aecf424fc623ad47f to your computer and use it in GitHub Desktop.
Clean up demo product install
$prod = "myapp"
while ($($t = get-process | ? { $_.Name -match $prod }; $t -ne $null)) { $t | Stop-Process -Force;sleep -Seconds 1 }
$apps = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -match $prod
}
foreach($app in $apps) {
$app.Uninstall();
}
$repos = "C:\dir1","V:\dir2","V:\dir3"
foreach($repo in $repos)
{
rm -Force -Recurse $repo
mkdir $repo
}
Start-Process -FilePath "explorer" -ArgumentList "v:\installerfiles"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment