mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 13:04:59 +02:00
Update the docs for *firefox* and *chrome* scripts
This commit is contained in:
@ -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
|
||||
}
|
25
Scripts/uninstall-chrome.ps1
Normal file
25
Scripts/uninstall-chrome.ps1
Normal 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
|
||||
}
|
Reference in New Issue
Block a user