PSScriptAnalyzer icon indicating copy to clipboard operation
PSScriptAnalyzer copied to clipboard

Download ScriptAnalyzer from PowerShellGallery

Results 201 PSScriptAnalyzer issues
Sort by recently updated
recently updated
newest added

## PR Summary This PR fixes the following longstanding issue: https://github.com/PowerShell/PSScriptAnalyzer/issues/1300 (Global variables are erroneously reported as "never used") The issue exists because `Helper.IsVariableGlobalOrEnvironment` uses an `Ast` to key into...

## PR Summary Fixes #1472 This is WIP as at the moment, using a parameter in another function would yield a false negative. An alternative implementation would be to allow...

## PR Summary This is to show an example of running the Daily version of PowerShell in CI. Unfortunately one test fails (both in daily and preview in CI) but...

PowerShell has two parsing modes: * [**Expression mode**](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing#expression-mode) * [**Argument mode**](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing#argument-mode) It is not always clear whenever PowerShell is in **argument mode**, as in: ```PowerShell if (&{ (1,2,3).Where{ $_ -eq...

Issue - New Rule
Up-for-Grabs
Issue-Enhancement

Like the title says, it would be useful if I was warned whenever I try to reuse a global variable's name in a more local scope. ``` powershell $a =...

Issue - New Rule
Up-for-Grabs

Before submitting a bug report: - Make sure you are able to repro it on the latest released version - Perform a quick search for existing issues to check if...

Resolution - Answered

Before submitting a bug report: - [X] Make sure you are able to repro it on the latest released version - [X] Perform a quick search for existing issues to...

Steps to reproduce ------------------ ```PowerShell $FilePath = '' $ScriptDefinition = (Get-Content -Raw -Path $FilePath).Trim() $SettingsFile = "$HOME/.config/powershell/PSScriptAnalyzerSettings.psd1" if ($SettingsFile) { $FormatterSplat = @{ Settings = $SettingsFile ScriptDefinition = $ScriptDefinition }...

Need Repro Info

**Summary of the new feature** As a user I want a devcontainer added so I can more easily work on this project. **Proposed technical implementation details (optional)** Create a `./.devcontainer/devcontainer.json`...

**Summary of the new feature** It would be nice with a rule to find and remove unused `using namespace` statements similar to what you can do in C# in editors...

Issue - New Rule
Up-for-Grabs