What does $_ mean in PowerShell?

后端 未结 6 934
孤城傲影
孤城傲影 2020-12-02 04:07

I\'ve seen the following a lot in PowerShell, but what does it do exactly?

$_
6条回答
  •  执念已碎
    2020-12-02 05:06

    $_ is an alias for automatic variable $PSItem (introduced in PowerShell V3.0; Usage information found here) which represents the current item from the pipe.

    PowerShell (v6.0) online documentation for automatic variables is here.

提交回复
热议问题