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