Skip to content

Make Settings type detection more robust - #1967

Merged
Andy Jordan (andyleejordan) merged 2 commits into
PowerShell:mainfrom
Tadas:master
Feb 20, 2025
Merged

Make Settings type detection more robust#1967
Andy Jordan (andyleejordan) merged 2 commits into
PowerShell:mainfrom
Tadas:master

Conversation

@Tadas

@Tadas Tadas Medišauskas (Tadas) commented Feb 16, 2024

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks and sorry for late review. Kicked off CI and pending that all good.

Comment thread Engine/Settings.cs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully the tests still pass because I didn't test that myself!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants