Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ documentation for the latest release is published on on learn.microsoft.com.
## Installation

To install **PSScriptAnalyzer** from the PowerShell Gallery, see
[Installing PSScriptAnalyzer](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/overview#installing-psscriptanalyzer).
[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
Copy link

Copilot AI Nov 13, 2025

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:

  1. Remove the Set-PSRepository line entirely and let users respond to the interactive prompt when running Install-Module, or
  2. Use the -Force parameter with Install-Module to bypass the prompt for this specific installation only:
Install-Module -Name PSScriptAnalyzer -Force
Suggested change
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

Copilot uses AI. Check for mistakes.
Install-Module -Name PSScriptAnalyzer
Copy link

Copilot AI Nov 13, 2025

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 CurrentUser

This allows users to install the module without requiring administrator privileges.

Suggested change
Install-Module -Name PSScriptAnalyzer
Install-Module -Name PSScriptAnalyzer -Scope CurrentUser

Copilot uses AI. Check for mistakes.
```

To install **PSScriptAnalyzer** from source code:

Expand Down