Guest User

Untitled

a guest
Sep 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. $apiToken = $env:ApiToken
  2. $username = $env:Username
  3. $apiUrl = $env:ApiUrl
  4.  
  5. $appsUri = "$Uri/$Username/apps?apiToken=$ApiToken"
  6. $apps = Invoke-RestMethod -Uri $appsUri
  7.  
  8. Write-Output $apps
  9.  
  10. $jsonBody = @{Description = $description} | ConvertTo-JSON
  11.  
  12. $newAppName = 'NewApp004'
  13.  
  14. $createAppUrl = "$apiUrl/$username/apps/$newAppName?apiToken=$apiToken"
  15.  
  16. $params = @{
  17. Uri = $createAppUrl
  18. Method = 'Put'
  19. ContentType = 'application/json'
  20. Body = $jsonBody
  21. }
  22.  
  23. $returnValue = Invoke-RestMethod @params
  24.  
  25. Write-Output $returnValue
Add Comment
Please, Sign In to add comment