diff --git a/Scripts/install-vlc.ps1 b/Scripts/install-vlc.ps1 index eafe5624..93cf9168 100755 --- a/Scripts/install-vlc.ps1 +++ b/Scripts/install-vlc.ps1 @@ -5,6 +5,8 @@ This PowerShell script installs the VLC media player. .EXAMPLE PS> ./install-vlc.ps1 + ⏳ Installing VLC media player... + ✔️ Installation of VLC media player took 25 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -12,12 +14,14 @@ #> try { - "Installing VLC media player, please wait..." + "⏳ Installing VLC media player..." + $StopWatch = [system.diagnostics.stopwatch]::startNew() - & winget install --id VideoLAN.VLC --accept-package-agreements --accept-source-agreements - if ($lastExitCode -ne "0") { throw "'winget install' failed" } + & 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?" } - "VLC media player installed successfully." + [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds + "✔️ Installation of VLC media player took $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/uninstall-vlc.ps1 b/Scripts/uninstall-vlc.ps1 index 4379cdb9..c8a45ca1 100755 --- a/Scripts/uninstall-vlc.ps1 +++ b/Scripts/uninstall-vlc.ps1 @@ -4,7 +4,9 @@ .DESCRIPTION This PowerShell script uninstalls the VLC media player from the local computer. .EXAMPLE - PS> ./uninstall-vlc + PS> ./uninstall-vlc.ps1 + ⏳ Uninstalling VLC media player... + ✔️ Removal of VLC media player took 7 sec .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -12,12 +14,14 @@ #> try { - "Uninstalling VLC media player, please wait..." + "⏳ Uninstalling VLC media player..." + $StopWatch = [system.diagnostics.stopwatch]::startNew() - & winget uninstall "VLC" + & winget uninstall --id XPDM1ZW6815MQM if ($lastExitCode -ne "0") { throw "Can't uninstall VLC media player, is it installed?" } - "VLC media player is uninstalled now." + [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds + "✔️ Removal of VLC media player took $Elapsed sec" exit 0 # success } catch { "Sorry: $($Error[0])"