-
Notifications
You must be signed in to change notification settings - Fork 404
Added user-friendly installation instructions #2141
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
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 adds inline PowerShell commands to the README.md file to provide users with a quick installation method for PSScriptAnalyzer directly from the documentation, complementing the existing link to the detailed installation guide.
- Added inline PowerShell code snippet for installing PSScriptAnalyzer from PowerShell Gallery
- Provided command to set PSGallery as a trusted repository before installation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [Installing PSScriptAnalyzer](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/overview#installing-psscriptanalyzer) or simply open PowerShell in a Terminal and run: | ||
|
|
||
| ```powershell | ||
| Set-PSRepository -Name PSGallery -InstallationPolicy Trusted |
Copilot
AI
Nov 13, 2025
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.
Setting the PSGallery repository to "Trusted" globally is a security risk and should not be recommended in installation instructions. This bypasses PowerShell's security prompts for package installations from PSGallery.
Instead, either:
- Remove the
Set-PSRepositoryline entirely and let users respond to the interactive prompt when runningInstall-Module, or - Use the
-Forceparameter withInstall-Moduleto bypass the prompt for this specific installation only:
Install-Module -Name PSScriptAnalyzer -Force| Set-PSRepository -Name PSGallery -InstallationPolicy Trusted |
|
|
||
| ```powershell | ||
| Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | ||
| Install-Module -Name PSScriptAnalyzer |
Copilot
AI
Nov 13, 2025
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 -Scope parameter should be specified for Install-Module to clarify where the module will be installed. Without it, PowerShell will attempt to install to AllUsers scope which requires elevated permissions, potentially causing the command to fail for non-admin users.
Consider updating to:
Install-Module -Name PSScriptAnalyzer -Scope CurrentUserThis allows users to install the module without requiring administrator privileges.
| Install-Module -Name PSScriptAnalyzer | |
| Install-Module -Name PSScriptAnalyzer -Scope CurrentUser |
PR Summary
PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.