I am making an API call to a CI Name to update the Site and Assign Ownership to a user. (Below API call). The API call is also modifying the Total Memory for some reason. Is there a reason why the call is modifying this field? (Below image)
The API call is wrapped in a Windows Form where we are collect the data from the end-user. So there is more involved with the script than just the call below. But the remaining aspects of the script is creating the form and passing variables.
$requestComputerBody = @"
<?xml version='1.0' encoding='UTF-8'?>
<API version='1.0' >
<citype>
<name>Workstation</name>
<criterias>
<criteria>
<parameter>
<name compOperator='IS'>CI Name</name>
<value>$($computerNumber).vgminc.local</value>
</parameter>
</criteria>
</criterias>
<newvalue>
<record>
<!-- Product Name/Type cannot be updated using Update Operations-->
<!--parameter><name>Product Name</name><value>Unknown Server</value></parameter-->
<parameter>
<name>Site</name>
<value>$($Site)</value>
</parameter>
<parameter>
<name>Asset State</name>
<value>In Use</value>
</parameter>
<!-- Multi value parameters -->
<multi-valued-parameter name="Assign Ownership">
<record>
<parameter><name>User</name><value>$($userFullName)</value></parameter>
</record>
</multi-valued-parameter>
</record>
</newvalue>
</citype>undefined
</API>
"@
#Make Service Desk API call
$computerParams = @{INPUT_DATA = $requestComputerBody; TECHNICIAN_KEY = $technicianKey; OPERATION_NAME = 'update'; format ='xml';}
$updateState = Invoke-RestMethod -Method POST -Uri $url -Body $computerParams