[quote quote=140937]What is the execution policy on the server you are trying to execute your PowerShell commands/script?
How are you executing these scripts, from a local server / remote server / local workstation?
Like Olaf and David, we are trying to understand the limitation or why you can’t execute commands / error. You shouldn’t have to use batch files anymore, a PowerShell script or multiple scripts pending on your procedure should be enough.
[/quote]
I am scripting on a remote server. I am using remoteNG/RDP to connect to this server.
It’s a windows 10 server
Its internet access is blocked by a proxy. After a whole 2 weeks of research, I was finally able to successfully bypass the proxy by playing with the registry and writing a couple lines of command in a powershell profile.
Since running automated jobs on autosys is our ultimate goal, our team used to write batch scripts because that’s what an autosys command accepts. As such, I had to use a batch file in order for autosys to understand what to do, since its batch prompt.
And through this batch file, I am launching powershell file.
At some point, if I ran the powershell script standalone through autosys, I would get an execution policy error (on server).
We had to include the execution policy line I posted above in the batch file in order for the powershell script to run through autosys. And hence, I have always been writing and testing my powershell s ripts through this batch file to launch powershell session.
All I wanted from this post, is I dont like the looping exit code 0 output. The script is working great, I just done like the display. That’s all there is to this thread.
I just want to know if I can suppress this exit code 0, by having some sort of where clause on out-null.