1

When set up of remote PowerShell session is impossible for me I'm using the psexec tool for launching scripts remotely. I'm asking for correct exit code of psexec in loop. Syntax of psexec which I'm using is this:

./psexec.exe \\$Hostname -u $Username -p $Password -i ("c:\something.bat")

Is there any possibility to hide output in PowerShell console of psexec in each loop? I would like to see only the last success one.

I tried Out-Null, calling with [void] or $null redirection, but it seems as this is cmd command this don't work.

1 Answer 1

1

Try using the [void] accelerator, like so: [void] ./psexec.exe `$hostname...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.