mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-11 05:43:53 +02:00
Improved check for $lastExitCode
This commit is contained in:
@ -18,7 +18,7 @@ try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
& winget install --id XPDM1ZW6815MQM --accept-package-agreements --accept-source-agreements
|
||||
if ($lastExitCode -ne "0") { throw "Can't install VLC media player, is it already installed?" }
|
||||
if ($lastExitCode -ne 0) { throw "Can't install VLC media player, is it already installed?" }
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✅ Installation of VLC media player took $Elapsed sec"
|
||||
|
Reference in New Issue
Block a user