& 有什么作用?powershell中的符号是什么意思? [英] What does the & symbol in powershell mean?
本文介绍了& 有什么作用?powershell中的符号是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$tool = 'C:\Program Files\gs\gs9.07\bin\gswin64c.exe'
& $tool -q -dNOPAUSE -sDEVICE=tiffg4 $param -r300 $pdf.FullName -c quit
有人可以向我解释这是如何工作的吗?& 到底是做什么的?powershell 中的符号 do/mean?
Can someone explain to me how the this works? What exactly does the & symbol do/mean in powershell?
推荐答案
&
是调用运算符,它允许您执行命令、脚本或函数.更多详情:&
&
is the call operator which allows you to execute a command, a script, or a function. For more details: &
Syntax
& "[path] command" [arguments]
示例:
$LocalComputerName = & $ENV:windir\System32\HostName.exe
此外,如果您使用 IDE(例如 PowerGUI
),您可以在执行辅助进程时阻止它打开一个单独的窗口:
Also, if you use an IDE (such as PowerGUI
) you can block it from opening a separate window when executing a secondary process:
& more
Start-Process "my_script.here"
这篇关于& 有什么作用?powershell中的符号是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文