Advertisement
Guest User

Untitled

a guest
Mar 15th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. param([string]$groupID, [string]$certSubject, [string]$admin)
  2. Write-Host $groupID
  3. Write-Host $certSubject
  4. Write-Host $admin
  5.  
  6. #LoadUWGroupsRestClient
  7. #################core inputs#######################
  8. $serviceEndPoint = "https://iam-ws.u.washington.edu:7443/group_sws/v2"
  9. $uri = $serviceEndPoint + "/group/" + $groupID
  10. Write-Host "Attempting to create resource at $uri"
  11. ##$admin comes from parameters
  12. ##$groupID comes from parameters
  13. ##$certSubject comes from parameters
  14. ###################################################
  15.  
  16. [UWGroups.RestClient.IResource] $resource = $client.CreateResource($uri)
  17. # attempt to get the resource (even though it doesn't exist yet)
  18. $response = $resource.Get()
  19. Write-Host "Get $groupID status code:" $response.StatusCode
  20. # attempt to create the resource
  21. ## Create a resource representation
  22. [string] $xml = "<!DOCTYPE html PUBLIC `"-//W3C//DTD XHTML 1.1//EN`"
  23.    `"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd`">
  24.    <html xmlns=`"http://www.w3.org/1999/xhtml`" xml:lang=`"en`">
  25.        <head>
  26.            <title></title>
  27.        </head>
  28.        <body>
  29.            <div class=`"group`">
  30.                <span class=`"description`">$groupID</span>
  31.                <ul class=`"names`">
  32.                    <li class=`"name`">$groupID</li>
  33.                </ul>
  34.                <ul class=`"admins`">
  35.                    <li class=`"admin`">$admin</li>
  36.                </ul>
  37.            </div>
  38.        </body>
  39.    </html>"
  40. $response = $resource.Put($xml)
  41. Write-Host $response.StatusCode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement