From d1efe4c8e8e9acd8ce9eefbe38e3cc7e6427c950 Mon Sep 17 00:00:00 2001 From: Squillario Date: Thu, 15 Dec 2022 11:03:19 -0700 Subject: [PATCH] updated example script --- Examples/ServicesGroupCreateAddDevices.ps1 | 44 ++++++++++++++++++---- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/Examples/ServicesGroupCreateAddDevices.ps1 b/Examples/ServicesGroupCreateAddDevices.ps1 index 1f4d338..d9170b2 100644 --- a/Examples/ServicesGroupCreateAddDevices.ps1 +++ b/Examples/ServicesGroupCreateAddDevices.ps1 @@ -3,12 +3,42 @@ $Hosts = @("859N3ZZ", "759N3ZZ") $GroupJsonString = @' { "Id": 0, - "MyAccountId": 0, - "Description": "", - "Name": "", + "MyAccountId": null, + "Description": "Support Assist Test Group 1", + "Name": "Support Assist Test Group 1", + "DispatchOptIn": true, "ContactOptIn": true, - "DispatchOptIn": false, "CustomerDetails": { + "ShippingDetails": { + "AddressLine1": "109 Gelante Way", + "TechnicianRequired": true, + "PrimaryContact": { + "LastName": "Curell", + "Phone": "1111111111", + "AlternatePhone": "", + "FirstName": "Grant", + "Email": "grant_curell@meiguo.com" + }, + "AddressLine4": "", + "City": "Dayton", + "Country": "US", + "DispatchNotes": "No", + "State": "Ohio", + "SecondaryContact": { + "LastName": "Curell", + "Phone": "9999999999", + "AlternatePhone": "", + "FirstName": "Angela", + "Email": "grantcurell@wojia.com" + }, + "Cnpj": null, + "AddressLine3": "78210", + "PreferredContactTimeFrame": "10:00 AM-4:00 PM", + "Zip": "45459", + "Ie": null, + "PreferredContactTimeZone": "TZ_ID_65", + "AddressLine2": "San Antonio TX" + }, "PrimaryContact": { "LastName": "Curell", "TimeZone": "TZ_ID_10", @@ -30,7 +60,7 @@ $GroupJsonString = @' "Email": "grantcurell@zheshiwotaitai.com" } } - } +} '@ # Convert json string to PowerShell object @@ -40,10 +70,10 @@ $GroupJson = $GroupJsonString | ConvertFrom-Json $GroupJson.Name = $GroupName # Print output to screen -Write-Host $($GroupJson | ConvertTo-Json) +Write-Host $($GroupJson | ConvertTo-Json -Depth 10) # Create Services group from json string -New-OMESupportAssistGroup -AddGroup $($GroupJson | ConvertTo-Json) -Verbose +New-OMESupportAssistGroup -AddGroup $($GroupJson | ConvertTo-Json -Depth 10) -Verbose # Get newly created group $GroupName | Get-OMEGroup | Format-List