-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Update-Install-WinUtilChoco.ps1 #3846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Real-MullaC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should kept in a try catch just so if there is any issues with it installing it will say.
|
@Real-MullaC ye but the catch message dosen't do anything anyway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR simplifies the Chocolatey installation function by using -UseBasicParsing with Invoke-WebRequest and removing manual setup steps that Chocolatey's installation script already handles.
Key Changes:
- Removed try-catch error handling block
- Removed manual execution policy and security protocol configuration
- Simplified installation to a single
Invoke-WebRequestcommand with-UseBasicParsingpiped toInvoke-Expression
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
|
|
||
| Write-Host "Chocolatey is not installed, installing now." | ||
| Invoke-WebRequest https://community.chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line Invoke-WebRequest https://community.chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression downloads and immediately executes a remote PowerShell script without any integrity or authenticity verification beyond basic TLS, creating a supply-chain RCE risk if the Chocolatey host, DNS, or a trusted CA is compromised. An attacker who can tamper with responses from community.chocolatey.org could execute arbitrary code with the privileges of this script during installation. To mitigate, avoid the curl | IEX pattern by downloading the installer to disk, verifying a strong checksum/signature or pinning to a trusted hash/version, and only then executing the verified script.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Using -UseBasicParsing makes it so it dosen't ask you to confirm execution, and you dont need the other things choco already dose them for you