Skip to content

Instantly share code, notes, and snippets.

@WilliamBerryiii
Created September 15, 2015 06:57
Show Gist options
  • Save WilliamBerryiii/9a35f1ff85620012475f to your computer and use it in GitHub Desktop.
Save WilliamBerryiii/9a35f1ff85620012475f to your computer and use it in GitHub Desktop.
Filter a list of Scriptrock nodes and update their connection manager.
$nodes |
where { $_.operating_system_family_id -eq 1 } |
Foreach {
$resource = "/api/v1/nodes/$_.id"
$uri = $target + $resource
Invoke-RestMethod -Method put -Uri $uri -Headers $headers -Body '{"node": {"connection_manager_group_id": 6}}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment