• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Powershell script to run commands remotely via TRIGGERcmd

Instructions
2
2
2.8k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    Russ
    last edited by Jul 6, 2018, 10:38 PM

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

    $postdata = @{
        trigger='notepad'
        computer='Laptop'
        # 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

    Russell VanderMey

    V 1 Reply Last reply Nov 1, 2023, 1:26 AM Reply Quote 0
    • R Russ referenced this topic on Jan 5, 2022, 10:39 PM
    • R Russ referenced this topic on Jan 5, 2022, 10:40 PM
    • V
      Viniciusmbs @Russ
      last edited by Nov 1, 2023, 1:26 AM

      @Russ como posso efetuar este comando o powershel?

      start microsoft-edge:https://www.xbox.com/pt-BR/play/launch/forza-horizon-5-edição-padrão/9NKX70BBCDRN

      $wshell = New-Object -ComObject wscript.shell;

      $wshell.AppActivate('edge')

      while ($true)
      {
      Sleep 2
      $wshell.SendKeys('{f11}')
      exit
      }

      exit

      1 Reply Last reply Reply Quote 0
      2 out of 2
      • First post
        2/2
        Last post