I want to pass a single computer to the machines parameter or all computers from an OU. If I create a variable before the parameter the param doesn’t work.
The param will not work with the $All variable if I remove that line it works with a single computer.
If you’re trying to give the parameter a default value for when you call the script without specifying, you need to assign to the parameter inside the parameter block instead. Below is one way you can write it.