Skip to content

Install-Vlc

Installs VLC

#requires -version 5.1

try {
	"? Installing VLC media player from WinGet..."
	$stopWatch = [system.diagnostics.stopwatch]::startNew()

	& 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
	"? VLC media player installed successfully in $($elapsed)s."
	exit 0 # success
} catch {
	"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
	exit 1
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.