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
# The above cases ran as expected if I skip the substring step$toValidate=$myInv.Line# or added a prefix
[scriptblock]::Create( '( + '$ToValidate ).Ast.EndBlock.Statements[0].PipelineElements[0]
The text was updated successfully, but these errors were encountered:
When
$CallingContext
is falsy,$ToValidate
can truncate the prefix of the command. of the command. Causing a syntax error.It's essentially an off-by-one error when it calls substring. (It's off by 2 in this case)
The error occurs on these lines: Use-Git.ps1
Commands that can trigger it
Error Message
To reproduce
It does not error if ran interactively. It's deterministic. A script either fails 100% or 0% depending on the calling context.
$callingContext
is true null$myInv.Line
has a prefix of(
I'm guessing this is referencing the wrong frame, when invoked by vs code
Example State
Potential fix
The text was updated successfully, but these errors were encountered: