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
Invoke-ScriptAnalyzer : Object reference not set to an instance of an object.
At line:1 char:2
+ Invoke-ScriptAnalyzer -ScriptDefinition '[foo]::SecurityProtocol = [ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-ScriptAnalyzer], NullReferenceException
+ FullyQualifiedErrorId : RULE_ERROR,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand
If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *
writeErrorStream : True
PSMessageDetails :
Exception : System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.AvoidAssignmentToAutomaticVariable.<AnalyzeScript>d__2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.ScriptAnalyzer.<>c__DisplayClass82_1.<AnalyzeSyntaxTree>b__2()
TargetObject :
CategoryInfo : InvalidOperation: (:) [Invoke-ScriptAnalyzer], NullReferenceException
FullyQualifiedErrorId : RULE_ERROR,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}
writeErrorStream : True
PSMessageDetails :
Exception : System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.AvoidAssignmentToAutomaticVariable.<AnalyzeScript>d__2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.ScriptAnalyzer.<>c__DisplayClass82_1.<AnalyzeSyntaxTree>b__2()
TargetObject :
CategoryInfo : InvalidOperation: (:) [Invoke-ScriptAnalyzer], NullReferenceException
FullyQualifiedErrorId : RULE_ERROR,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}
Environment data
This bug was introduced in 1.17.0 in the new PSAvoidAssignmentToAutomaticVariable
Thanks to @lipkau for the initial bug report in Slack.
Steps to reproduce
Expected behavior
Normal behaviour, no warnings.
Actual behavior
If an unexpected error was thrown then please report the full error details using e.g.
$error[0] | Select-Object *
Environment data
This bug was introduced in 1.17.0 in the new
PSAvoidAssignmentToAutomaticVariable
The text was updated successfully, but these errors were encountered: