Hi there,
I have a script where I am importing Intune data into Assets via a POST from powershell.
I am stuck trying to get the fields that are date and time over as they are a text string when it comes into Powershell and turned into JSON and isn't recognised when it is sent over to Assets. If the Assets attribute was text it works fine, but I need to build some automations around these fields that are going to do date calcuations.
The value looks like this in the JSON
{
"objectTypeAttributeId": 385,
"objectAttributeValues": [
{
"value": "17/01/2023 14:41"
}
but it is text.
I am not sure what to do in order to get Assets to accept this as a datetime value?
When I am building the customobject that sets the fields for the JSON I do this conversion
$user | Add-Member -NotePropertyName 'Warranty Expiry Date' -NotePropertyValue $("{0:dd-MM-yyyy HH:mm}" -f $user."Warranty Expiry Date") -Force
but is Assets looking for the field in a particular format to be passed over and accepted as a Datetime?