Update the docs for *firefox* and *chrome* scripts

This commit is contained in:
Markus Fleschutz
2023-09-08 20:09:27 +02:00
parent 843a12ed7d
commit 84a62b5d4c
4 changed files with 33 additions and 37 deletions

View File

@ -1,29 +0,0 @@
<#
.SYNOPSIS
Installs the Chrome browser
.DESCRIPTION
This PowerShell script installs the latest Google Chrome Web browser.
.EXAMPLE
PS> ./install-chrome-browser.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
$Path = $env:TEMP;
$Installer = "chrome_installer.exe"
Invoke-WebRequest "http://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path\$Installer
Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait
Remove-Item $Path\$Installer
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ installed Google Chrome in $Elapsed sec"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -0,0 +1,25 @@
<#
.SYNOPSIS
Uninstalls the Chrome browser
.DESCRIPTION
This PowerShell script uninstalls the Google Chrome browser from the local computer.
.EXAMPLE
PS> ./uninstall-chrome.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
"⏳ Uninstalling Google Chrome..."
& winget uninstall --id Google.Chrome
if ($lastExitCode -ne "0") { throw "Can't uninstall Google Chrome, is it installed?" }
"✔️ Google Chrome is uninstalled now."
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}