Closed LaurentDardenne closed 5 years ago
With the following code :
if ($isLiteral) { Set-Content -Value $TypeData -LiteralPath $FileName -Encoding UTF8 -Confirm:$false} else { Set-Content -Value $TypeData -Path $FileName -Encoding UTF8 -Confirm:$false}
Call ConvertTo-SplatExpression by F1 do not work correctly :
if ($isLiteral) $setContentSplat = @{ Value = $TypeData LiteralPath = $FileName } { Set-Content @setContentSplat} else { Set-Content -Value $TypeData -Path $FileName -Encoding UTF8 -Confirm:$false}
No error with this text :
if ($isLiteral) { Set-Content -Value $TypeData -LiteralPath $FileName -Encoding UTF8 -Confirm:$false } else { Set-Content -Value $TypeData -Path $FileName -Encoding UTF8 -Confirm:$false}
Thanks for reporting this! I see what I did wrong :)
I'm in the middle of rewriting a lot of this in C#, I've confirmed the new code doesn't have the same issue. I'll leave this open until that release.
With the following code :
Call ConvertTo-SplatExpression by F1 do not work correctly :
No error with this text :