mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-14 04:25:05 +02:00
Updated install-vlc.ps1
This commit is contained in:
parent
17ca5ec974
commit
4abee2a2ac
@ -5,8 +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
|
||||
⏳ Installing VLC media player from Winget...
|
||||
✅ VLC media player installed successfully in 25s.
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -14,16 +14,16 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
"⏳ Installing VLC media player..."
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
"⏳ Installing VLC media player from WinGet..."
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
& winget install --id XPDM1ZW6815MQM --accept-package-agreements --accept-source-agreements
|
||||
& winget install --id VideoLAN.VLC --accept-package-agreements --accept-source-agreements
|
||||
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"
|
||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
"✅ VLC media player installed successfully in $($elapsed)s."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
"⚠️ Error: $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user