mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-21 01:14:26 +02:00
Updated the manuals
This commit is contained in:
@@ -17,8 +17,8 @@ Example
|
||||
-------
|
||||
```powershell
|
||||
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.
|
||||
|
||||
```
|
||||
|
||||
@@ -40,8 +40,8 @@ Script Content
|
||||
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
|
||||
@@ -49,19 +49,19 @@ Script Content
|
||||
#>
|
||||
|
||||
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
|
||||
if ($lastExitCode -ne "0") { throw "Can't install VLC media player, is it already installed?" }
|
||||
& 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
|
||||
}
|
||||
```
|
||||
|
||||
*(page generated by convert-ps2md.ps1 as of 01/23/2025 12:15:21)*
|
||||
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:54)*
|
||||
|
Reference in New Issue
Block a user