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
Exception : System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Windows.PowerShell.ScriptAnalyzer.Helper.<>c__DisplayClass61_0.<GetTypeFromMemberExpressionAst>b__0(TypeDefinitionAst item)
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.Helper.GetTypeFromMemberExpressionAst(MemberExpressionAst memberAst, Ast scopeAst, IEnumerable`1 classes)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.FindPipelineOutput.VisitInvokeMemberExpression(InvokeMemberExpressionAst invokeAst)
at System.Management.Automation.Language.InvokeMemberExpressionAst.Accept(ICustomAstVisitor visitor)
at System.Management.Automation.Language.Ast.Visit(ICustomAstVisitor astVisitor)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.FindPipelineOutput.VisitCommandExpression(CommandExpressionAst commandAst)
at System.Management.Automation.Language.CommandExpressionAst.Accept(ICustomAstVisitor visitor)
at System.Management.Automation.Language.Ast.Visit(ICustomAstVisitor astVisitor)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.FindPipelineOutput.VisitPipeline(PipelineAst pipelineAst)
at System.Management.Automation.Language.PipelineAst.Accept(ICustomAstVisitor visitor)
at System.Management.Automation.Language.Ast.Visit(ICustomAstVisitor astVisitor)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.FindPipelineOutput.VisitNamedBlock(NamedBlockAst namedBlockAst)
at System.Management.Automation.Language.NamedBlockAst.Accept(ICustomAstVisitor visitor)
at System.Management.Automation.Language.Ast.Visit(ICustomAstVisitor astVisitor)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.FindPipelineOutput.VisitScriptBlock(ScriptBlockAst scriptBlockAst)
at System.Management.Automation.Language.ScriptBlockAst.Accept(ICustomAstVisitor visitor)
at System.Management.Automation.Language.Ast.Visit(ICustomAstVisitor astVisitor)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.FindPipelineOutput..ctor(FunctionDefinitionAst ast, IEnumerable`1 classes)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.FindPipelineOutput.OutputTypes(FunctionDefinitionAst funcAst, IEnumerable`1 classes)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.UseOutputTypeCorrectly.VisitFunctionDefinition(FunctionDefinitionAst funcAst)
at System.Management.Automation.Language.FunctionDefinitionAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.StatementBlockAst.InternalVisit(AstVisitor visitor, ReadOnlyCollection`1 traps, ReadOnlyCollection`1 statements, AstVisitAction action)
at System.Management.Automation.Language.NamedBlockAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.ScriptBlockAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.Ast.Visit(AstVisitor astVisitor)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.UseOutputTypeCorrectly.AnalyzeScript(Ast ast, String fileName)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.ScriptAnalyzer.<>c__DisplayClass82_1.<AnalyzeSyntaxTree>b__2()
If an unexpected error was thrown then please report the full error details using e.g. $error[0] | Select-Object *
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 6.1.3
PSEdition Core
GitCommitId 6.1.3
OS Microsoft Windows 10.0.18860
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0> (Get-Module-ListAvailable PSScriptAnalyzer).Version |ForEach-Object { $_.ToString() }
1.18.01.16.1
The text was updated successfully, but these errors were encountered:
Before submitting a bug report:
Steps to reproduce
Execute
Invoke-ScriptAnalyzer
on file which has:Expected behavior
Actual behavior
If an unexpected error was thrown then please report the full error details using e.g.
$error[0] | Select-Object *
Environment data
The text was updated successfully, but these errors were encountered: