Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hybrid batch powershell script - exitcode

23 views
Skip to first unread message

Petr Laznovsky

unread,
Feb 2, 2020, 12:21:56 PM2/2/20
to
Running powershell oneliners inside of my batch script and want to check
if powershell terminate with error or exit correctly. Tried to read
%errorlevel% value just after oneliner terminate, but is always '0'. is
there any way to check powershell exitcode?


some_batch_code_here............
powershell.exe -command "& { iwr http://www.it1.net/it1_logo2.jpg
-OutFile logo.jpg }"
echo %errorlevel%
0
some_other_batch_code_here..............

L.
0 new messages