question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invoke-ScriptAnalyzer required Path parameter

See original GitHub issue

The required -Path parameter is a usability concern. It should default to . removing the need for the required parameter.

Is there a reason or design choice of why this parameter is required without a default value?

Steps to reproduces

Invoke-ScriptAnalyzer

Expected behavior

# just runs
Invoke-ScriptAnalyzer

Actual behavior

Invoke-ScriptAnalyzer

cmdlet Invoke-ScriptAnalyzer at command pipeline position 1
Supply values for the following parameters:
Path:

If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *

Environment data

> $psversiontable

Name                           Value
----                           -----
PSVersion                      7.3.2
PSEdition                      Core
GitCommitId                    7.3.2
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

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

1.21.0
1.20.0
1.19.1
1.18.3

Issue Analytics

  • State:open
  • Created 8 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bergmeistercommented, Feb 6, 2023

I don’t think there was a particular reason other than ask user to be explicit but I’d be ok with having such a default.

0reactions
bergmeistercommented, Mar 2, 2023

The bot did it because of the ‘Need repro info’ tag

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invoke-ScriptAnalyzer (PSScriptAnalyzer) - PowerShell
A path to a file containing a user-defined profile or a hashtable object containing settings for ScriptAnalyzer. Runs Invoke-ScriptAnalyzer with the parameters ......
Read more >
Allow Invoke-ScriptAnalyzer to take in piped paths or ...
Looking at the help for the function, the Path parameter does not allow for pipeline input. Is this supposed to be supported?
Read more >
Using PSScriptAnalyzer - PowerShell
Use the Settings parameter of Invoke-ScriptAnalyzer to specify ... Invoke-ScriptAnalyzer -Path /path/to/module/ -Settings PSGallery -Recurse.
Read more >
en-US/about_PSScriptAnalyzer.help.txt 1.4.0
Specify the Recurse parameter if you also want sub-directories searched for files to analyze. PS C:\> Invoke-ScriptAnalyzer -Path . -Recurse
Read more >
en-US/Microsoft.Windows.PowerShell.ScriptAnalyzer.dll- ...
To add rules defined in subdirectories of the path, use the RecurseCustomRulePath parameter. </maml:para> <maml:para>By default, Invoke-ScriptAnalyzer uses only ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found