PDQ command line: args outside of script (PRTG > PDQ)



  • Colby Bouma

    You can use a param block to pass data into a PowerShell script when you call it.

    param (
    [Parameter(Mandatory = $true)]

    [Parameter(Mandatory = $true)]

    [String[]]$Target = $env:COMPUTERNAME

    Invoke-Command -ComputerName $PdqServer -ScriptBlock {PDQDeploy.exe Deploy -Package $Using:Package -Targets $Using:Target}

    Here's a couple examples of calling this script:

    & .\Example.ps1 -Package 'Wake Up' -PdqServer prtgserver.domain.co.uk -Target %host
    & .\Example.ps1 -Package 'Wake Up' -PdqServer prtgserver.domain.co.uk -Target PC1, PC2, PC3
    Comment actions Permalink
  • Michael Yorke

    Amazing! Thanks Colby. This works perfectly when testing on its own. It doesn't work in PRTG - so I need to take it up with them and see what's happening and try to get the logs.

    I'll post back here with a solution.


    Comment actions Permalink

Please sign in to leave a comment.