|
|
||||||
|
#1
|
|
|
|
|
If you run your script like this:
powershell -command "& {C:\Path of PS1 file\FileName.ps1}" can you check the return code of that execution? Thanks. |
|
|
|
#2
|
|
|
|
|
AHartman wrote:
> If you run your script like this: >> > powershell -command "& {C:\Path of PS1 file\FileName.ps1}" >> > can you check the return code of that execution? >> Thanks. Check this blog for a tip: http://dmitrysotnikov.wordpress.com/...-availability/ Marco |
|
#3
|
|
|
|
|
The only way to do this is to process the output returned by the command.
Assuming you are running from Cmd.exe, PowerShell does not set an errorlevel on exit - probably because it's difficult to map the results of a PS operation into a single flat error code, since the internal standard is error objects. If you're running PowerShell within PowerShell, however, the $? variable will be $false if errors were encountered and $true if not. One potential workaround is to get the output in XML format and then have an XML processing tool parse it. I suspect that's way beyond what will be practical for you, though. : s "AHartman" <Hoosbruin> wrote in message news:nz2d [..] |
|
#4
|
|
|
|
|
Doh! Ignore me. I completely forgot that you could use exit $LASTEXITCODE as
Marco's link points out. "Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message news:5596 [..] |
|
|
| Similar Threads | |
| Data shape command text contains a syntax error at or near position 106 in the command. 2007 .adp front ends connected to SQL 2005. I frequently run into this when users are drilling into data on a DataSheet form. They may filter on a value in one column and... |
|
| autorun.inf - shell\..\command with command line parameter doesn'twork Below a piece of my autorun.inf file I have problems with: shell\slides00 = slides '&slideshow all' shell\slides00\command = _Tools_\XnView\xnview.exe... |
|
| howto count differrent command fields on lsof command (newbie question) Hello all, first let me apologize if you find this question too stupid to post it to this group :-) I have some problem with swap space utilization and for this reason... |
|
| Newbi Question - what is the command line command for launching the file explorer on RH Linux? Hi, This is a newbi question. Can some one please tell me the command line command for launching the file explorer on RH Linux? Thanks, T. |
|
| command object command throws error after windows NT to win2k migration My company has four web servers running copies of same ASP web application. One of the servers is running on windows 2000 Advanced server edition (without service pack) ,... |
|
|
All times are GMT. The time now is 01:37 AM. | Privacy Policy
|