Skip to content

Commit

Permalink
updated example script
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorSquillario committed Dec 15, 2022
1 parent 7154619 commit d1efe4c
Showing 1 changed file with 37 additions and 7 deletions.
44 changes: 37 additions & 7 deletions Examples/ServicesGroupCreateAddDevices.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]"
},
"AddressLine4": "",
"City": "Dayton",
"Country": "US",
"DispatchNotes": "No",
"State": "Ohio",
"SecondaryContact": {
"LastName": "Curell",
"Phone": "9999999999",
"AlternatePhone": "",
"FirstName": "Angela",
"Email": "[email protected]"
},
"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",
Expand All @@ -30,7 +60,7 @@ $GroupJsonString = @'
"Email": "[email protected]"
}
}
}
}
'@

# Convert json string to PowerShell object
Expand All @@ -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
Expand Down

0 comments on commit d1efe4c

Please sign in to comment.