Hi,
I’m trying to edit the TenantedDeploymentParticipation parameter of my machines via Powershell through the REST API. I’m able to get the json object of a machine and change the parameter within the object. However, when I try to call PUT to update, I keep getting 400 errors.
PS C:\Users\15SOF> $machine
Id : Machines-724
Name : Server01
Thumbprint : 0384B258021C16819A779370DD7706E3D7AE7B9B
Uri :
IsDisabled : False
EnvironmentIds : {Environments-1}
Roles : {app-server}
MachinePolicyId : MachinePolicies-1
TenantedDeploymentParticipation : TenantedOrUntenanted
PS C:\Users\15SOF> Invoke-WebRequest $OctopusURL/api/machines/$machineId -Method Put -Headers $header -Body $machine
Invoke-WebRequest : The remote server returned an error: (400) Bad Request.
At line:1 char:1
- Invoke-WebRequest $OctopusURL/api/machines/$machineId -Method Put -H …
-
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Any help or suggestions are greatly appreciated!
Thanks!