mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-02-04 15:00:09 +00:00
Update-Install-WinUtilChoco.ps1 (#3846)
* Update Install-WinUtilChoco.ps1 * Update Install-WinUtilChoco.ps1 * Update Install-WinUtilChoco.ps1 * Update functions/private/Install-WinUtilChoco.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -6,23 +6,10 @@ function Install-WinUtilChoco {
|
|||||||
Installs Chocolatey if it is not already installed
|
Installs Chocolatey if it is not already installed
|
||||||
|
|
||||||
#>
|
#>
|
||||||
|
if ((Test-WinUtilPackageManager -choco) -eq "installed") {
|
||||||
try {
|
return
|
||||||
Write-Host "Checking if Chocolatey is Installed..."
|
|
||||||
|
|
||||||
if((Test-WinUtilPackageManager -choco) -eq "installed") {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
# Install logic taken from https://chocolatey.org/install#individual
|
|
||||||
Write-Host "Seems Chocolatey is not installed, installing now."
|
|
||||||
Set-ExecutionPolicy Bypass -Scope Process -Force;
|
|
||||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
|
|
||||||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
|
||||||
|
|
||||||
} catch {
|
|
||||||
Write-Host "===========================================" -Foregroundcolor Red
|
|
||||||
Write-Host "-- Chocolatey failed to install ---" -Foregroundcolor Red
|
|
||||||
Write-Host "===========================================" -Foregroundcolor Red
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Host "Chocolatey is not installed, installing now."
|
||||||
|
Invoke-WebRequest -Uri https://community.chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user