behe
behe

Reputation: 199

powershell: how to execute commands on server and let server keep the output information?

I am running powershell command on my local machine to start a batch file on remote server. However, the server always returns the echo outputs of the batch file to my local machine, which is not what i want. Can we execute commands on server and let server keep the output information?

Thanks in advance!

Upvotes: 0

Views: 357

Answers (1)

nGX
nGX

Reputation: 1068

Have you tried Invoke command?

Invoke-Command -ComputerName machinename -ScriptBlock {ipconfig > C:\temp.txt}

Upvotes: 1

Related Questions