Pass variables to new deployment?
Powershell/Deploy Question.
We only have PowerShell remoting on servers. I am using this command from one deployment to call another deployment to a separate machine.
Invoke-Command -ComputerName $(PDQDeployServerHostName) -ScriptBlock { param ($compname) & 'C:\Program Files (x86)\Admin Arsenal\PDQ Deploy\pdqdeploy.exe' Deploy -Package "Package Name Here" -Targets $using:CompVariable} -ArgumentList "$env:COMPUTERNAME"
[EDIT: The command works fine, I'm just looking to pass string variables to a new deployment that a PowerShell step could pick up.]
I saw that you can't pass variables between steps, but Is possible to pass PowerShell variables between new pdq deployments or is that still the same thing?
I'm trying to not utilize the PDQ Custom Variables for this because they limit my overall deployment to one computer at a time.
Thank you for your time.
Comments
I don't quite understand your setup. Are you trying to use Deploy to invoke another instance of Deploy?
Here's my idea:
Inventory Tool
SOURCE Package
TARGET Package
Yes, that is what I am doing but wanting to pass variables. It's a bit of a kludge.
To explain better, I'm using PDQ Inventory and Deploy backup and move user profiles over the network. Everything works great, but I'm limited to doing one computer at a time and waiting for the entire process to finish because of PDQ custom variables. I'm looking to improve it.
Steps go:
PDQ Inventory
PDQ Deploy Backup Deployment - 1 Raw Powershell step
PDQ Deploy Restore Package - 1 Raw Powershell step
If I were to backup/restore to 2 computers back to back there is a chance that when restoring that it would grab the wrong PDQ custom variable. So I want to pass a PowerShell variable over instead which should allow multiple computers to run without waiting for the entire process to finish before doing another computer.
Thank you Colby.
Finally had time to use your suggestion and with a little modification it worked out very well.