&
is the call operator which allows you to execute a command, a script, or a function.
For more details:
SS64 documentation: Call operator (&)
Microsoft Docs: Call operator &
Syntax
& "[path] command" [arguments]
Example:
$LocalComputerName = & $ENV:windir\System32\HostName.exe
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With