I wanted to create some clickable PowerShell scripts, and I found this answer that I modified slightly to be:
;@Findstr -bv ;@F %0 | powershell -noprofile -command - & goto:eof
# PowerShell Code goes here.
I understand Findstr is passing all lines that don’t begin with ;@F to the right-hand side of the pipe and the dash specifies where the input should go, but what is the dash character called and where is it documented?
I found an explanation of CMD’s pipe operator on Microsoft’s Using command redirection operators, but it doesn’t mention anything about the dash character.
I presume you mean the
-that precedes the&. It has nothing to do with the pipe operator, it is a directive for powershell.Here is a description of the -Command option excerpted from powershell help (accessed by
powershell /?)BTW – I did not realize FINDSTR accepted
-as an option indicator until I saw your question. I’ve only seen and used/. Good info to know.