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!
Comments
My script:
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.
Read the warning, then:
Also, I recommend making sure you're not accidentally breaking the licensing terms, such as by using shared credentials: https://www.pdq.com/licensing/