Question regarding powershell commands

Hello everyone,

I am trying to fasten / automate some of my administrative workflows with powershell and windows server.

I do not really understand how computer names from a powershell command actually get handed over to the script itself.

For example:

A simple one liner powershell script with content “Get-Hotfix” works for several computers that are in the “computer name” field:

Other commands like “Restart-Computer” do not work at all using this method.

Gues I will use the parameters then. But why does it work sometimes and sometimes not? Can you share some insight on this implementation?

Best regards,

Manuel

Local execution with no credentials supplied:

For a PowerShell connection, $URI$ is mainly used as a replacement token in configured script parameters.

Credentials are supplied

PowerShell is executed using a WSMan endpoint to that target (similar to PS remoting) when locally executed. On the server it’s a bit different from a technical perspective but the result should be the same.

I hope this helps.