Closed jasonrush closed 1 year ago
Create an Invoke-AutomateAPIRestMethod function, instead of a separate "Set-AutomateAPIGeneric" function.
Example code:
Function Invoke-AutomateAPIRestMethod { param( $Endpoint, $Method, $Body) $TokenExpiration = [DateTime]::Parse($TokenObject.ExpirationDate) if((Get-Date) -gt $TokenExpiration) { Connect-AutomateAPI } Invoke-RestMethod -Uri "$($script:baseurl)$Endpoint" -Method $Method -Headers $script:header -Body $Body #-ContentType "application/json" }
Marking closed. All calls are handled through the single Invoke-AutomateAPIMaster function.
Create an Invoke-AutomateAPIRestMethod function, instead of a separate "Set-AutomateAPIGeneric" function.
Example code: