Powershell script to run commands remotely via TRIGGERcmd

  • administrators

    Here's an example Powershell script you could use to call the TRIGGERcmd API to run a remote command:

    $postdata = @{
        # params='optionalparameter.txt'
    $token=Get-Content ~\.TRIGGERcmdData\token.tkn
    $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
    $headers.Add("authorization", "Bearer " + $token)
    $json = $postdata | ConvertTo-Json
    $response = Invoke-RestMethod 'https://www.triggercmd.com/api/run/triggerSave' -Method Post -Body $json -ContentType 'application/json' -Headers $headers

Log in to reply

Looks like your connection to TRIGGERcmd Forum was lost, please wait while we try to reconnect.