Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Powershell RedirectStandardOutput

Posted on 2013-10-31
5
Medium Priority
?
344 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 41

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 41

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

722 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