Skip to content

PSScriptAnalyzerSettings.psd1 not Used Implicitly when used together with *. for -Path parameter #978

Closed
@alx9r

Description

@alx9r

In #975(comment) @bergmeister wrote the following:

...and if you name it PSScriptAnalyzerSettings.psd1 then those settings get applied implicitly if you run Invoke-ScriptAnalyzer from the root without having to specify the -Settings parameter...

Steps to reproduce

  1. Extract the zip PssaVscode.zip with full paths.
  2. Set PowerShell's location to the folder containing PSScriptAnalyzerSettings.psd1.
  3. Invoke Invoke-ScriptAnalyzer *.

Expected behavior

No output as an indication of no errors.

Actual behavior

RuleName                            Severity     ScriptName Line  Message
--------                            --------     ---------- ----  -------
PSAvoidUsingCmdletAliases           Warning      PssaVscode 2     '%' is an alias of
                                                 .psm1            'ForEach-Object'. Alias can
                                                                  introduce possible problems and
                                                                  make scripts hard to maintain.
                                                                  Please consider changing alias
                                                                  to its full content.

Environment data

> $PSVersionTable

Name                           Value                                                              
----                           -----                                                              
PSVersion                      5.1.14409.1012                                                     
PSEdition                      Desktop                                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                            
BuildVersion                   10.0.14409.1012                                                    
CLRVersion                     4.0.30319.42000                                                    
WSManStackVersion              3.0                                                                
PSRemotingProtocolVersion      2.3                                                                
SerializationVersion           1.1.0.1                                                            

> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.16.1
1.16.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions