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
Code auto formatting (Shift+Alt+F) works incorrect if it tries to format indents after any SubExpression operator $(expression) usage.
Note: It works correct if SubExpression is inside double quotes.
Example 1 (in param assigning):
function Expected
{
param( $one = $(throw "Set var value check"),
$two,
$three
)
Write-Verbose "Some other code"
}
function Current
{
param( $one = $(throw "Set var value check"),
$two,
$three
)
Write-Verbose "Some other code"
}
Example 2 (in code):
function AnotherCurrent
{
if ($true)
{
if ($true)
{
Write-Verbose "Correct indent"
$var = $(Get-FreeDriveLetter) + ":";
Write-Verbose "Indent now broken"
}
$var = $(Get-FreeDriveLetter) + ":";
Write-Verbose "Indent now broken again"
}
}
function AnotherExpected
{
if ($true)
{
if ($true)
{
Write-Verbose "Correct indent"
$var = $(Get-FreeDriveLetter) + ":";
Write-Verbose "Expected Indent"
}
$var = $(Get-FreeDriveLetter) + ":";
Write-Verbose "Expected Indent"
}
}
function AnotherForQuotedSubExpression
{
if ($true)
{
if ($true)
{
Write-Verbose "Correct indent"
$var = "$(Get-FreeDriveLetter):";
Write-Verbose "Correct indent"
}
$var = "$(Get-FreeDriveLetter):";
Write-Verbose "Correct indent"
}
}
The text was updated successfully, but these errors were encountered:
System Details
$PSVersionTable
:Issue Description
Code auto formatting (Shift+Alt+F) works incorrect if it tries to format indents after any SubExpression operator $(expression) usage.
Note: It works correct if SubExpression is inside double quotes.
Example 1 (in param assigning):
Example 2 (in code):
The text was updated successfully, but these errors were encountered: