The command accepts a .ps1, .psm1 or .psd1 file, a folder, or several
paths. Folder scans are recursive unless -NoRecurse is supplied.
./src/Invoke-At0mFlowPSAnalyzer.ps1 -Path ./scriptsScan several paths:
./src/Invoke-At0mFlowPSAnalyzer.ps1 -Path ./build.ps1, ./src, ./toolsOnly show errors and warnings:
./src/Invoke-At0mFlowPSAnalyzer.ps1 -Path ./src -Severity Error, WarningThe wrapper skips .git, node_modules and vendor folders by default. Add or
replace wildcard patterns with -ExcludePath:
./src/Invoke-At0mFlowPSAnalyzer.ps1 `
-Path . `
-ExcludePath '*/.git/*', '*/node_modules/*', '*/vendor/*', '*/generated/*'Patterns are matched against full paths normalised with /, and against file
names. Use -ExcludePath '*.Tests.ps1' to skip matching file names.
Write a JSON report with the scan summary and all findings:
./src/Invoke-At0mFlowPSAnalyzer.ps1 `
-Path ./src `
-Format Json `
-OutputPath ./analysis.jsonWrite findings as CSV:
./src/Invoke-At0mFlowPSAnalyzer.ps1 `
-Path ./src `
-Format Csv `
-OutputPath ./analysis.csvOmit -OutputPath to send JSON or CSV to the success stream.
By default, findings do not make the command fail. Set a threshold when a CI job should stop:
# Fail for errors only
./src/Invoke-At0mFlowPSAnalyzer.ps1 -Path ./src -FailOnSeverity Error
# Fail for errors or warnings
./src/Invoke-At0mFlowPSAnalyzer.ps1 -Path ./src -FailOnSeverity Warning
# Fail for any returned finding
./src/Invoke-At0mFlowPSAnalyzer.ps1 -Path ./src -FailOnFindingsExit codes are:
0: scan completed and the selected failure threshold was not met.1: findings met the selected failure threshold.2: the scan could not run, such as a missing dependency or invalid path.
Pass any standard PSScriptAnalyzer settings file through to the underlying analyser:
./src/Invoke-At0mFlowPSAnalyzer.ps1 `
-Path ./src `
-Settings ./PSScriptAnalyzerSettings.psd1At0mFlow PSAnalyzer does not add proprietary rules, scoring or remediation. The finding rule names, severities and messages come from your installed PSScriptAnalyzer version and settings.