How to view Powershell output from deployment

Comments

6 comments

  • Stephen Valdinger

    The easiest way to get information into the output.log is to use something like:

    Write-Output "Whatever here", as their wrapper script will put the contents of that Write-Ouput into the Output.log file

    That being said, sometimes things can go a little sideways on you. What exactly are you needing to see in the log and maybe we can cobble something up together.

    0
    Comment actions Permalink
  • Rob Poling

    I set up a package to schedule chkdsk /f and reboot, but I want to be able to view the chkdsk log after it finishes, so I was going to try to use Get-EventLog.

    0
    Comment actions Permalink
  • Stephen Valdinger

    Should be simple then. The output of Get-EventLog will show up in Output.log

    You'll probably want to do some investigating of the event log in question so you know some details about what you are wanting to pull, mostly the source and possibly ID of the event so you can properly query the right log with Get-EventLog.

     

    0
    Comment actions Permalink
  • Stephen Valdinger

    Possibly something like this in a powershell step:

    Get-EventLog -LogName Application -Newest 1  | Where { $_.EventID -eq "Your Event ID Here" }
    0
    Comment actions Permalink
  • Rob Poling

    Awesome. Worked great. Thanks for the help!

    0
    Comment actions Permalink
  • Stephen Valdinger

    Hey, you're welcome. Glad it worked out well for ya!

    0
    Comment actions Permalink

Please sign in to leave a comment.