PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.8k stars 366 forks source link

Make Settings type detection more robust #1967

Open Tadas opened 4 months ago

Tadas commented 4 months ago

PR Summary

It was unable to parse settings hashtable, when that hashtable has been wrapped as a PSObject. This started happening in PS 7.2, I was using Import-PowerShellDataFile to read some settings before passing them on to Invoke-ScriptAnalyzer.

There was some code to handle wrapped strings, might as well do that with all parameter types.

PR Checklist

Tadas commented 4 months ago

Related to #807 but that particular scenario was being covered.