Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

API for remote Powershell deployment

(Warning in advance, PowerShell rookie here)

I have a PowerShell script that, when run from the target PC, will deploy a package from my PDQ server to the target using 'Invoke-Command'

It has 7 steps, installing various software. Most of the steps install flawlessly however, there is a step that occasionally fails and the PowerShell script isn't able to tell the user one of the steps failed. The script runs and shows completed whether or not the package was successfully installed.

Is there an API or some way for the PowerShell script to see the status of the package deployment and accurately report that to the user? 

Thank you!



Date Votes
  • My script:

    Invoke-Command -ComputerName "pdqserver" -Credential $credentials
  • Unfortunately, no, Deploy and Inventory do not have an API. To monitor the status of a deployment, you have to query the database. However, my PowerShell module PdqStuff has a cmdlet Get-PdqDeployment that makes it easy to pull deployment data out of the database.

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

    Read the warning, then:

    Get-Help -Name 'Get-PdqDeployment' -Full


    Also, I recommend making sure you're not accidentally breaking the licensing terms, such as by using shared credentials: