- In the "-command" argument block, a semicolon is an end-of-line delimiter, similar to C#
- Each line in the "-command" argument block is executed as if it were typed inside the PowerShell interface
Full command to load the Exchange console plus an additional script:
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer cas.companyname.com;Set-AdServerSettings -ViewEntireForest $True; C:\custom\scripts\Script2.ps1"
Scripting with the Exchange Management Shell