The –command parameter accepts a single Windows PowerShell command, along with any parameters that command requires. Enclose the entire command string in quotes if it contains any spaces or parameters. You can also include a complete pipeline of multiple
cmdlets, if needed.
You could also use the –file parameter. This accepts the path and filename of a .PS1 file. Windows PowerShell will then execute that file’s contents. This is a much easier way to run a complex series of commands than trying to jam them all into the –command
parameter. Keep in mind that the shell’s Execution Policy affects script execution, which brings us to the next point.
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.