You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PSUseCorrectCasing malfunctioning in DSC configuration #1474
What is happening is that this is because Type is a CommandAst and since the command info cache also contains aliases, it thinks this is the type alias (a default alias for Get-Content).
This behaviour is not new (since command name correction already existed in 1.18.3) and also happens in 1.18.3.
Theoretically one could exclude aliases from being corrected in this rule but I am not sure that would be the best just for this special case.
Therefore I am not sure how to proceed on this one.
Activity
bergmeister commentedon May 5, 2020
xtqqczze Thanks for the report. I can repro with both PSSA 1.18.3 and 1.19.0. Somehow PSSA only touches the
Typeproperty.bergmeister commentedon May 5, 2020
I will need to debug this in more detail but I suspect an erroneous
CommandInfocache entryRevert changes to `demos\DSC\dsc-demo.ps1`
bergmeister commentedon May 7, 2020
What is happening is that this is because
Typeis aCommandAstand since the command info cache also contains aliases, it thinks this is thetypealias (a default alias forGet-Content).This behaviour is not new (since command name correction already existed in 1.18.3) and also happens in 1.18.3.
Theoretically one could exclude aliases from being corrected in this rule but I am not sure that would be the best just for this special case.
Therefore I am not sure how to proceed on this one.
rjmholt commentedon May 12, 2020
If the rule uses a visitor, it could skip children when it sees a dynamickeywordstatementast or a configurationstatementast perhaps