Powershell: Changing NSX-T Segment Profiles enmasse.
Summary:
Note to self, cut back on the reddit. It's a time suck and VMware questions are popping up that I have time to answer w/o the shadow of a retired LucD bot lurking. Anyway, someone asked if you could update segment profiles, so I got curious and followed the rabbit.
Here is the example I came up with. It's straight powershell core, so no special modules needed, not even vmware.powercli. GASP!
Comments
$TargetMacDPName = "Allow-MacDiscoveryProfile"
Result:
Invoke-RestMethod:
Line |
9 | Invoke-restmethod -Uri ($base_url + $binding.results.path) -M …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
"module_name" : "common-services",
"error_message" : "The requested URI: /api/v1 could not be found.",
"error_code" : 258
}
Invoke-RestMethod:
Line |
9 | Invoke-restmethod -Uri ($base_url + $binding.results.path) -M …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| {
"module_name" : "common-services",
"error_message" : "The requested URI: /api/v1 could not be found.",
"error_code" : 258
}