I am having trouble running multiple commands in the Scriptblock parameter. All documentation indicates the use of a semicolon to separate cmdlets. Using the same methodology for separating cmdlets with semicolons works on my local machine, but not on the remote machine using the invoke command.
For example, the code below will return the result Get-Service, not Get-Process.
Invoke-Command -ComputerName cas-bkupexec -ScriptBlock { Get-Service; Get-Process }
How can I achieve the desired result of the successful work of both teams and get the result of each of them?
source
share