Skip to content

Commit

Permalink
userAgent on invoke rest method scripts (#478)
Browse files Browse the repository at this point in the history
* userAgent on invoke rest method scripts

* missing $
  • Loading branch information
jworkmanjc authored Mar 13, 2023
1 parent 920c23d commit c66315f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions scripts/automation/Radius/Config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ $CertType = "UsernameCn"
# Do not modify below
################################################################################

$UserAgent_ModuleVersion = '1.0.0'
$UserAgent_ModuleName = 'PasswordlessRadiusConfig'
#Build the UserAgent string
$UserAgent_ModuleName = "JumpCloud_$($UserAgent_ModuleName).PowerShellModule"
$Template_UserAgent = "{0}/{1}"
$UserAgent = $Template_UserAgent -f $UserAgent_ModuleName, $UserAgent_ModuleVersion
# When we import this config, this function will run and validate the openSSL binary location
function Get-OpenSSLVersion {
[CmdletBinding()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function Clear-JCQueuedCommand {
'x-api-key' = $Env:JCApiKey
'x-org-id' = $Env:JCOrgId
}
$response = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/v2/commandqueue/$workflowId" -Method DELETE -Headers $headers
$response = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/v2/commandqueue/$workflowId" -Method DELETE -Headers $headers -UserAgent $UserAgent
}
end {
return $response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Invoke-CommandRun {
$body = @{
_id = $commandID
} | ConvertTo-Json
$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/runCommand' -Method POST -Headers $headers -ContentType 'application/json' -Body $body
$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/runCommand' -Method POST -Headers $headers -ContentType 'application/json' -Body $body -UserAgent $UserAgent
}
end {
if (!$response.queueIds) {
Expand Down

0 comments on commit c66315f

Please sign in to comment.