Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .SYNOPSIS
- Invokes a new deployment from the PDQ install on a remote computer.
- .DESCRIPTION
- This command allows you to deploy any package found in PDQ Deploy remotely from command line.
- .EXAMPLE
- New-PDQDeployment -package "Flash Player" -targets "001-Computer" -credentials $(Get-Credential -UserName domain\admin)
- #>
- Function New-PDQDeployment {
- [CmdletBinding()]
- Param (
- # Param1 help description
- [Parameter()]
- $Package,
- [Parameter()]
- $Targets,
- [Parameter()]
- $Credentials
- )
- Begin {
- $s = New-PSSession -Credential $Credentials -computerName yourServerNameHere
- }
- Process {
- Invoke-Command -Session $s -Verbose -Scriptblock{
- $pdqfolder = "C:\Program Files (x86)\Admin Arsenal\PDQ Deploy\";
- cd $pdqfolder;
- .\pdqdeploy.exe Deploy -Package $args[0] -Targets $args[1]
- } -args @($Package,$Targets)
- }
- End {
- Remove-PSSession $s
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement