Solved

Powershell RedirectStandardOutput

Posted on 2013-10-31
5
312 Views
Last Modified: 2013-11-06
Hi,

I've got a Powershell script that's been running great for over a year. We just upgraded the application that the script interfaces with as well as made some application-related server updates and all of a sudden I'm not getting any log output from the below command:

Start-Process bulkimport.bat -Wait -PassThru -RedirectStandardOutput $LogPath `
            -ArgumentList "-user $Username -password $Password -dir $StagingDirInQuotes"

The file at $LogPath is just a zero byte file now. I tried removing "-RedirectStandardOutput $LogPath" and also see no output at the command line. I'm pretty sure the Powershell version has been not been updated. $PSVersionTable.psversion reveals:

Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1      

Any ideas what may be going on? I'd really appreciate your help.

Thanks very much.
0
Comment
Question by:DarthElmo
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:footech
ID: 39615176
Does the bulkimport.bat file run and output correctly when run either a PS console or cmd console?
0
 

Author Comment

by:DarthElmo
ID: 39615219
Yes, the bat file does run in a PS console and complete successfully. The log data is then very important to parse through after the bat file completes.

Thank you
0
 

Accepted Solution

by:
DarthElmo earned 0 total points
ID: 39616848
After further testing, I'm finding that if there's a failure with bulkimport.bat, just the error and nothing else is output. So it seems like the default debug level in the application may have changed from DEBUG or INFO to ERROR. Since no one here has access to the application, I'm cancelling this question. Footech, thank you for your time.
0
 
LVL 39

Expert Comment

by:footech
ID: 39616894
Not a problem.  Sorry I couldn't be of more help.  You might try some redirection to std output to see if that works for you, like "2>&1".
0
 

Author Closing Comment

by:DarthElmo
ID: 39626785
I now see that my question almost certainly cannot be answered without access to the application files.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now