PowerShell / PSScriptAnalyzer

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

Make Settings type detection more robust #1967

Open Tadas opened 9 months ago

Tadas commented 9 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 9 months ago

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