How to run powershell commands on remote windows server

We have a windows teamcity agent . We have multiple windows servers where we want to perform powershell commands. We are not able to get how to do it using any runner type.

0
2 comments

You will need to have your TeamCity Build Agent installed on the machine you wish to run the PowerShell commands on. Then, you can use the PowerShell runner to run PowerShell commands. It is possible to enter your commands directly into the runner as in the below screenshot, but it is also possible to run a PowerShell script file if that is what you would like.

0

If you wish to run the PowerShell commands on a remote host, you'll first need to Enable-PSRemoting on the remote host. Once this is properly configured, you should then be able to use Invoke-Command to run a command on the remote host using the PowerShell runner.

0

Please sign in to leave a comment.