View previsou steps that fail

Comments

1 comment

  • Colby Bouma

    I wrote a PowerShell script I think you might find useful. It outputs every Step that has an error. Let me know if you want it to do something else.

    Run this:

    Install-Module -Name 'PdqStuff'
    Import-Module -Name 'PdqStuff'

    Read the warning, then run this:

    Get-PdqDeployment -IncludeComputers -IncludeSteps | ForEach-Object {

    $Deployment = $_

    $Deployment.Computers | ForEach-Object {

    $Computer = $_

    $Computer.Steps | Where-Object Error | ForEach-Object {

    $Step = $_

    if ( $Step.OutputFile ) {

    $OutputLog = "$env:ProgramData\Admin Arsenal\PDQ Deploy\Deployment Output\$($Step.OutputFile)"

    } else {

    $OutputLog = $null

    }

    [PSCustomObject]@{
    'Deployment ID' = $Deployment.DeploymentId
    'Package Name' = $Deployment.PackageName
    'Computer Name' = $Computer.Name
    'Step Number' = $Step.Number
    'Step Name' = $Step.Title
    'Return Code' = $Step.ReturnCode
    'Error' = ([XML]$Step.Error).Error.Message
    'Output Log' = $OutputLog
    }

    }

    }

    }
    0
    Comment actions Permalink

Please sign in to leave a comment.