在CMD; |(&QUOT&QUOT)与管使用时, - ;(QUOT&QUOT)什么是几许? [英] What is the dash ("-") when used with pipe ("|") in CMD?

查看:181
本文介绍了在CMD; |(&QUOT&QUOT)与管使用时, - ;(QUOT&QUOT)什么是几许?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创造一些可点击的PowerShell脚本,我发现,我稍微修改为这个答案

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.

我理解 Findstr工具正在通过不以开头的行; @频率来右手管道的侧面和破折号指定了输入应该去,但什么是所谓的连字符和它在哪儿记录?

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?

我发现了CMD的管道运营商对微软的解释<一个href=\"http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true\"相对=nofollow>使用命令重定向操作符,但它没有提及破折号什么。

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.

推荐答案

我presume你的意思是 - 是precedes的&安培; 。它无关,与管道运营商,它是PowerShell的指令。

I presume you mean the - that precedes the &. It has nothing to do with the pipe operator, it is a directive for powershell.

下面是从PowerShell帮助中摘录的 - 命令选项的说明(通过访问的PowerShell /?

Here is a description of the -Command option excerpted from powershell help (accessed by powershell /?)

-Command
    Executes the specified commands (and any parameters) as though they were
    typed at the Windows PowerShell command prompt, and then exits, unless
    NoExit is specified. The value of Command can be "-", a string. or a
    script block.

    If the value of Command is "-", the command text is read from standard
    input.

顺便说一句 - 我不知道FINDSTR接受 - 作为一个选项指标,直到我看到你的问题。我只看到和使用 / 。良好的信息就知道了。

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.

这篇关于在CMD; |(&QUOT&QUOT)与管使用时, - ;(QUOT&QUOT)什么是几许?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆