Purpose
There are so many purposes for a Command Line Interface. If you would like to just simply manage your deployments and scans without opening a GUI or you want to run repetitive tasks in a batch file. Even creating a self-service portal for your environment if you opted in for the SL license. Though this article is not going to give a tutorial on creating a self-help portal it will give you information on how the CLI works.
How it Works
The prompt needs to be elevated and the syntax is going to be [Program] [Task] [Options].
To see the available options use the Help parameter
PDQDeploy Help [parameter]
For example, we will cover Deploying a package.
To see the full Syntax we will use Help again but we will add Deploy to see Help for that command
So if I wanted to deploy 7-Zip to my machine (I'll just use the loopback address in this example). I may need to pull the list of packages to see the full name of the package. To do this I'll start with a GetPackagesNames command and then follow with the Deploy command, what we use needs to be exactly how this is reported. You could also kick off a notification by using the -NotificationName parameter with how it is named in Reports>Notifications tab.
But we can add a lot of functionality to this if we add some PowerShell. Below I will fill a variable with the computers inside a collection and then deploy a patch to those targets.
Using these commands to Deploy packages using the CLI will not wait for deployment status to be returned, you will want to have a notification sent by using the -NotificationName parameter if you would like status to be sent to you while not using the GUI. We covered some basics using the CLI above and there are links in the Additional Resources sections that contain much more sophisticated and complex scripts.
Additional resources
https://link.pdq.com/docs-PDQDeploy?deploy-cli.htm
https://www.pdq.com/blog/commandline-and-keyboard-shortcuts-for-pdq-deploy/
https://www.pdq.com/blog/adding-custom-fields-multiple-computers-powershell/
PDQ Live! : PDQ Command Line Interface Best Practices - video
From one of our Community Posts;
https://github.com/steviecoaster/PSDeploy/blob/master/Deploy-Software/Deploy-Software.psm1
Comments
0 comments
Article is closed for comments.