PSScriptAnalyzer

noun

say it: “PEE-ESS SKRIPT AN-uh-ly-zer” /ˌpiˌɛs ˈskrɪpt ˈænəˌlaɪzər/

A free tool that reads a PowerShell script without running it and warns about lines likely to cause trouble.

What is PSScriptAnalyzer?

PSScriptAnalyzer is PowerShell's linter: it reads a script without running it and warns about lines likely to cause trouble. The PowerShell extension brings it with it, and in VS Code its advice shows as a yellow wavy line.

# Line 3 used the alias gci, and PSScriptAnalyzer underlined it:
#   'gci' is an alias of 'Get-ChildItem'. ... consider changing alias to its full content.
Get-ChildItem "$HOME\terminal-practice\scripts" -Name   # fixed: the yellow line goes away

In a sentence

  • “Sam pointed at the underlined line to read what PSScriptAnalyzer had to say.”
  • “PSScriptAnalyzer put a yellow wavy line under gci and suggested Get-ChildItem.”

Level: Apprentice · More PowerShell terms at this level

Updated