• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

Powershell RedirectStandardOutput

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
DarthElmo
Asked:
DarthElmo
  • 3
  • 2
1 Solution
 
footechCommented:
Does the bulkimport.bat file run and output correctly when run either a PS console or cmd console?
0
 
DarthElmoAuthor Commented:
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
 
DarthElmoAuthor Commented:
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
 
footechCommented:
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
 
DarthElmoAuthor Commented:
I now see that my question almost certainly cannot be answered without access to the application files.
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now