In a PowerShell window:
PS C:\> echo -abc.def.ghi
-abc
.def.ghi
For some reason, the combination of a hyphen and period cause Powershell to split the argument into two lines.
It does not occur with without the hyphen:
PS C:\> echo abc.def.ghi
abc.def.ghi
Nor does it occur when there are no periods:
PS C:\> echo -abcdefghi
-abcdefghi
Through experimentation, I've found I can escape the behavior with a backtick:
PS C:\> echo `-abc.def.ghi
-abc.def.ghi
But why does this occur? What fundamental part of PowerShell syntax am I not understanding?
echo "-abc.def"
works as expected so that might be a hint{echo -abc.def.ghi}.Ast.EndBlock.Statements[0].PipelineElements[0].CommandElements
to see, how this is interpreted by parser.