How to check command line output?

Hi guys.

I am using teamcity for build my asp.net site, but before i upload it to server i need turn off IIS. I use command line for this
"iisreset workserver1 /stop" and it should stop IIS server on workserver1. The problem here it can fail too and show command line response with some error.
How i can add some logic which get output from this command line and parse it it show or this step was successful or fail.

Duke

1 comment
Comment actions Permalink

Write a wrapper that does the parsing, then call the wrapper.
IMO, you should avoid text parsing and rely only on the return codes.

0

Please sign in to leave a comment.