File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -525,16 +525,12 @@ public class Wallpaper
525
525
# Ask which program to uninstall
526
526
$UninsNum = Read-Host " `n Select the number of the program you wish to uninstall, or leave blank to exit"
527
527
if ($UninsNum -match " \S" -and $UninsNum -in 0 .. ($PgListNum - 1 )) {
528
- try {
529
-
530
- } catch {
528
+ try {
529
+ & $UninstallString
530
+ } catch {
531
531
$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 "
538
534
}
539
535
} else {
540
536
Write-Output " `n Canceled`n "
You can’t perform that action at this time.
0 commit comments