Created
August 30, 2018 18:39
-
-
Save tdewin/1b4d991bdbd4b50aecf424fc623ad47f to your computer and use it in GitHub Desktop.
Clean up demo product install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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