What does the & symbol in powershell mean?

& 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 & Example: Also, if you use an IDE (such as PowerGUI) you can block it from opening a separate window when executing a secondary process:

How do I do ‘dir /s /b’ in PowerShell?

If you are using Powershell as a shell (and not as a script processor), you can simply type: The /r flag tells cmd.exe to run the command and exit. In other words, you’ll end at the same execution context. For many commands, cmd /r is better than dealing with Powershell object-oriented architecture.

Create a function with optional call variables

Powershell provides a lot of built-in support for common parameter scenarios, including mandatory parameters, optional parameters, “switch” (aka flag) parameters, and “parameter sets.” By default, all parameters are optional. The most basic approach is to simply check each one for $null, then implement whatever logic you want from there. This is basically what you have already … Read more

accessing the $args array in powershell

Try this instead: Note that it is $args and not $arg. Also when you use a PowerShell variable in a string, PowerShell only substitutes the variable’s value. You can’t directly use an expression like $args[0]. However, you can put the expression within a $() sub-expression group inside a double-

How can I test that a variable is more than eight characters in PowerShell?

Use the length property of the [String] type: Please note that you have to use -gt instead of > in your if condition. PowerShell uses the following comparison operators to compare values and test conditions: -eq = equals (==) -ne = not equals (!=) -lt = less than (<) -gt = greater than (>) -le = less than or equals (<=) -ge = greater than or equals (>=)