Public/Invoke-Deployment.ps1
function Invoke-Deployment { <# .SYNOPSIS Deploy a PDQ package to a host. .PARAMETER Package PDQ Deploy package name. .PARAMETER Targets Target computers. .EXAMPLE !deploy 7zip stnjn109.sunssc.local #> [PoshBot.BotCommand( CommandName = 'deploy', Aliases = ('deploy', 'deploypackage', 'install') )] [cmdletbinding()] param( [parameter(Mandatory)] [string]$Package, [parameter(Mandatory)] [string]$Targets ) $result = Invoke-Command -Computername pdq.sunssc.local -ScriptBlock { PDQDeploy.exe Deploy -Package $Using:Package -Targets $Using:Targets } New-PoshBotTextResponse -Text ($result | Out-String) -AsCode } |