I’m a beginner with PS and couldn’t find on the network the information:
I want to start process on my computer only after a specific service is on “Running” status in another computer in the same network.
i believe that it’s a kind of a loop that will stop and then will run the start-process cmdlet when the service is running. 1 second interval between every attempt required.
$Using notation is a feature made available from PS 3.0. This will help to use local variables in a remote session. If I create a variable $foo = 1
I will access it like $using:foo in a remote session.
Correct me if i’m wrong, PSsession or invoke-command will not work if WinRM is not enabled at the RemotePC.
When i’m writing in my computer Get-Service -ComputerName Computer1 -Name ServiceName it provides the requested information.
all i need is that when the status is running, go to the next step which is start-process
yup, PSSessions can be created only via PowerShell remoting which is using winrm (till 5.1) and of course above solution is best if you have winrm contrains.