Skip to content

Commit 829fce2

Browse files
authored
Update Readme.md
1 parent 7616ab5 commit 829fce2

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

Readme.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,35 @@ All examples below assume a new session has already been created.
5858

5959
### Getting incidents opened in the last 30 days
6060
```PowerShell
61-
$filter = @('opened_at', '-ge', (Get-Date).AddDays(-30))
62-
Get-ServiceNowRecord -Table incident -Filter $filter
61+
Get-ServiceNowRecord -Table incident -Filter @('opened_at', '-ge', (Get-Date).AddDays(-30))
6362
```
6463

6564
### Retrieving an Incident Containing the Word 'PowerShell'
6665

6766
```PowerShell
68-
Get-ServiceNowRecord -Table incident -Filter @('short_description','-like','PowerShell')
67+
Get-ServiceNowRecord -Table incident -Description 'powershell'
6968
```
7069

7170
### Update a Ticket
7271

7372
```PowerShell
74-
Get-ServiceNowRecord -First 1 -Filter @('short_description','-eq','PowerShell') | Update-ServiceNowIncident -Values @{comments='Updated via PowerShell'}
73+
Get-ServiceNowRecord -First 1 -Description 'powershell' | Update-ServiceNowRecord -InputData @{comments='Updated via PowerShell'}
7574
```
7675

7776
### Creating an Incident with custom table entries
7877

7978
```PowerShell
80-
$IncidentParams = @{Caller = "UserName"
81-
ShortDescription = "New PS Incident"
82-
Description = "This incident was created from Powershell"
83-
CustomFields = @{u_service = "MyService"
84-
u_incident_type = "Request"}
85-
}
86-
New-ServiceNowIncident @Params
79+
$params = @{
80+
Caller = "UserName"
81+
ShortDescription = "New PS Incident"
82+
Description = "This incident was created from Powershell"
83+
InputData = @{
84+
u_service = "MyService"
85+
u_incident_type = "Request"
86+
urgency = 1
87+
}
88+
}
89+
New-ServiceNowIncident @params
8790
```
8891

8992
### Azure Connection Object (Automation Integration Module Support)

0 commit comments

Comments
 (0)