mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-15 04:54:48 +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.
|
This PowerShell script installs the VLC media player.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./install-vlc.ps1
|
PS> ./install-vlc.ps1
|
||||||
⏳ Installing VLC media player...
|
⏳ Installing VLC media player from Winget...
|
||||||
✅ Installation of VLC media player took 25 sec
|
✅ VLC media player installed successfully in 25s.
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -14,16 +14,16 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
"⏳ Installing VLC media player..."
|
"⏳ Installing VLC media player from WinGet..."
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$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?" }
|
if ($lastExitCode -ne 0) { throw "Can't install VLC media player, is it already installed?" }
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✅ Installation of VLC media player took $Elapsed sec"
|
"✅ VLC media player installed successfully in $($elapsed)s."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error: $($Error[0])"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user