Skip to content

Allow Invoke-ScriptAnalyzer to take in piped paths or FileInfos #1132

Closed
@kitforbes

Description

@kitforbes

Summary of the new feature

As a user I would like to add the -Exclude parameter to Invoke-ScriptAnalyzer so that I can ignore certain directories from analysis.

In my case, I want to test all of my ps1 files, except those within a vendor directory, as these come from a third party. With Get-ChildItem, I can achieve this with

Get-ChildItem -Path "$PSScriptRoot" -Filter "*.ps1" -Recurse -Exclude "$PSScriptRoot\vendor"

I would expect Invoke-ScriptAnalyzer to have a similar implementation:

Invoke-ScriptAnalyzer -Path "$PSScriptRoot" -Recurse -Exclude "$PSScriptRoot\vendor"

What is the latest version of PSScriptAnalyzer at the point of writing

1.17.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions