API/Scripting/ExecuteCommand - working but no result
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.1k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
I get no result object from "API/Scripting/ExecuteCommand". It seems to timeout after 30 seconds and I get a 404 exception.
To Reproduce
$server = "http://xxx.xxx.xx:5000"
$headers = @{ Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("xxx:xxx")))" }
$g = Invoke-WebRequest -Uri "$server/api/Devices" -Method Get -Headers $headers -ContentType "application/json" -UseBasicParsing -ErrorAction Stop
($g.Content | ConvertFrom-Json) | Select-Object organizationID, id, deviceName, osDescription | Out-GridView -OutputMode Multiple | % {
$d = $_
$p = Invoke-WebRequest -Uri "$server/API/Scripting/ExecuteCommand/PSCore/$($d.id)" -Method Post -Headers $headers -Body "Get-Culture" -ContentType "application/json" -UseBasicParsing -ErrorAction Stop
}
$g = Invoke-WebRequest -Uri "$server/API/ScriptResults" -Method Get -Headers $headers -ContentType "text/plain" -UseBasicParsing -OutFile "$env:TEMP\r.json" -UseBasicParsing -ErrorAction Stop
(Get-Content "$env:TEMP\r.json" | ConvertFrom-Json) | Out-GridView -OutputMode Multiple
Remotely Version
Version: 2023.06.24.1218 (docker preview)
Expected Behavior
Get a result similar to the one from API/ScriptResults
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the API/Scripting/ExecuteCommand/PSCore/{device id} endpoint and compare its behavior with API/ScriptResults. Reproduce the PowerShell request using the supplied example; done means ExecuteCommand returns a result without the 30-second timeout or 404 exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100