Skip to content

Conversation

@admercs
Copy link

@admercs admercs commented Nov 13, 2025

PR Summary

PR Checklist

Copilot AI review requested due to automatic review settings November 13, 2025 18:27
Copilot finished reviewing on behalf of admercs November 13, 2025 18:29
Copy link

Copilot AI left a 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
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.

```powershell
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant