Invoke-ScriptAnalyzer required Path parameter
See original GitHub issueThe 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:
- Created 8 months ago
- Comments:7 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
The bot did it because of the ‘Need repro info’ tag