Skip to content

Commit ef5971e

Browse files
Update setup.ps1
1 parent b8eb5a3 commit ef5971e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

setup.ps1

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -525,16 +525,12 @@ public class Wallpaper
525525
# Ask which program to uninstall
526526
$UninsNum = Read-Host "`nSelect the number of the program you wish to uninstall, or leave blank to exit"
527527
if ($UninsNum -match "\S" -and $UninsNum -in 0..($PgListNum-1)) {
528-
try {
529-
530-
} catch {
528+
try {
529+
& $UninstallString
530+
} catch {
531531
$UninstallString = $PROGRAMS.UninstallString[$UninsNum]
532-
$UninstallString = $UninstallString -replace '"',''
533-
try {
534-
Start-Process "$UninstallString"
535-
} catch {
536-
Invoke-Expression "$UninstallString"
537-
}
532+
# I know you are not supposed to use Invoke-Expression, but there does not seem to be another way
533+
Invoke-Expression "& $UninstallString"
538534
}
539535
} else {
540536
Write-Output "`nCanceled`n"

0 commit comments

Comments
 (0)