$FilePath = "C:\packages.csv"
$Package = Import-CSV $FilePath
foreach ($App in $Package) {
try {
Remove-AppxPackage -package $App.Package -errorvariable MyErr -erroraction Stop
}
catch {
"$MyErr" | Out-File "$env:SYSTEMDRIVE\USERS\$env:USERNAME\Desktop\failed.txt" -Append
}
}
Look at that, it even has some nice try/catch going on and everything. The errors are going to be written to a file on your desktop.
If you destroy your computer or crash any airplanes running this, itโs on you. I canโt guarantee and donโt care that any Metro app will ever run again after doing this, so run at your own risk.
Pages: 1 2