Skip to content

Commit 49f465c

Browse files
authored
Update Readme.md
1 parent 6316feb commit 49f465c

File tree

1 file changed

+8
-70
lines changed

1 file changed

+8
-70
lines changed

Readme.md

Lines changed: 8 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ServiceNow
22

3-
[![GitHub release](https://img.shields.io/github/release/Snow-Shell/servicenow-powershell.svg)](https://github.com/Snow-Shell/servicenow-powershell/releases/latest) [![GitHub license](https://img.shields.io/github/license/Snow-Shell/servicenow-powershell.svg)](LICENSE) ![Test Coverage](https://img.shields.io/badge/coverage-75%25-yellow.svg)
3+
[![GitHub release](https://img.shields.io/github/release/Snow-Shell/servicenow-powershell.svg)](https://github.com/Snow-Shell/servicenow-powershell/releases/latest) [![GitHub license](https://img.shields.io/github/license/Snow-Shell/servicenow-powershell.svg)](LICENSE)
44

55
This PowerShell module provides a series of cmdlets for interacting with the [ServiceNow REST API](http://wiki.servicenow.com/index.php?title=REST_API), performed by wrapping `Invoke-RestMethod` for the API calls.
66

@@ -16,28 +16,6 @@ Building on the great work the community has done thus far, a lot of new updates
1616
- Pipeline support added to many functions
1717
- Standardizing on coding between all functions
1818

19-
## Version 1
20-
21-
The module has been renamed from PSServiceNow to ServiceNow for version 1. This change moves us away from the reserved "PS" prefix. Since the name change is a major change for the user base and the project was never incremented to v1 we've taken the opportunity to label it such.
22-
23-
In addition to the name change the following high level changes have been made:
24-
25-
Back End:
26-
27-
* The module structure has been updated to individual files for each function.
28-
* The build process has been migrated from MAKE to psake with support of the BuildHelpers module.
29-
* Pester testing has been expanded to cover more scenarios.
30-
* Improved code formatting, removed aliases, fixed file encoding.
31-
32-
The gains are marginal in some aspects, but intended to allow for better management in the future.
33-
34-
Front End:
35-
36-
* The following fields are now returned in the DateTime format instead of string: 'closed_at','expected_start','follow_up','opened_at','sys_created_on','sys_updated_on','work_end','work_start' [v1.0.1 Update: This process now attempts to format the property as DateTime based off your local culture settings, a universal `yyyy-MM-dd HH:mm:ss` format, and finally leaves the property as a string if those two convert attempts fail].
37-
* The formatting of returned data has been updated across all the `Get` functions except `Get-ServiceNowTable`. This means you'll see a handful of default properties returned and can use `Format-List` or `Select-Object` to view all other properties associated with the object.
38-
39-
These changes should improve your ability to filter on the right, especially by DateTime, as well as return more information in general.
40-
4119
## Requirements
4220

4321
Requires PowerShell 3.0 or above as this is when `Invoke-RestMethod` was introduced.
@@ -50,38 +28,26 @@ Requires authorization in your ServiceNow tenant. Due to the custom nature of S
5028

5129
## Usage
5230

53-
Download the [latest release](https://github.com/Snow-Shell/servicenow-powershell/releases/latest) and extract the .psm1 and .psd1 files to your PowerShell profile directory (i.e. the `Modules` directory under wherever `$profile` points to in your PS console) and run:
54-
`Import-Module ServiceNow`
55-
Once you've done this, all the cmdlets will be at your disposal, you can see a full list using `Get-Command -Module ServiceNow`.
31+
The ServiceNow module should be installed from the PowerShell Gallery with `install-module ServiceNow`.
5632

57-
### Example - Using Set-ServiceNowAuth
33+
### Creating a new session
5834

5935
```PowerShell
60-
Set-ServiceNowAuth -url InstanceName.service-now.com -Credentials (Get-Credential)
36+
New-ServiceNowSession -url InstanceName.service-now.com -Credentials (Get-Credential)
6137
```
6238

63-
The URL should be the instance name portion of the FQDN for your instance. If you browse to `https://yourinstance.service-now.com` the URL required for the module is `yourinstance.service-now.com`.
39+
This example is using basic authentication, but OAuth is available as well; see the built-in help for `New-ServiceNowSession`. All examples below assume a new session has already been created.
6440

6541
### Example - Retrieving an Incident Containing the Word 'PowerShell'
6642

6743
```PowerShell
68-
Import-Module ServiceNow
69-
Set-ServiceNowAuth
7044
Get-ServiceNowIncident -MatchContains @{short_description='PowerShell'}
7145
```
7246

73-
### Example - Retrieving an Incident Containing the Word 'PowerShell' While Passing Authentication
74-
75-
```PowerShell
76-
Import-Module ServiceNow
77-
Get-ServiceNowIncident -MatchContains @{short_description='PowerShell'} -ServiceNowCredential $PSCredential -ServiceNowURL $ServiceNowURL
78-
```
79-
8047
### Example - Update a Ticket
8148

8249
```PowerShell
83-
$Incident = Get-ServiceNowIncident -Limit 1 -MatchContains @{short_description='PowerShell'}
84-
Update-ServiceNowIncident -SysID $Incident.Sys_ID -Values @{comments='Updated via PowerShell'}
50+
Get-ServiceNowIncident -Limit 1 -MatchContains @{short_description='PowerShell'} | Update-ServiceNowIncident -Values @{comments='Updated via PowerShell'}
8551
```
8652

8753
### Example - Creating a Incident with custom table entries
@@ -102,41 +68,13 @@ The module can use the `Connection` parameter in conjunction with the included `
10268

10369
The `Connection` parameter accepts a hashtable object that requires a username, password, and ServiceNowURL.
10470

105-
## Functions
106-
107-
* Add-ServiceNowAttachment
108-
* Get-ServiceNowAttachment
109-
* Get-ServiceNowAttachmentDetail
110-
* Get-ServiceNowChangeRequest
111-
* Get-ServiceNowConfigurationItem
112-
* Get-ServiceNowIncident
113-
* Get-ServiceNowRequest
114-
* Get-ServiceNowRequestItem
115-
* Get-ServiceNowTable
116-
* Get-ServiceNowTableEntry
117-
* Get-ServiceNowUser
118-
* Get-ServiceNowUserGroup
119-
* New-ServiceNowChangeRequest
120-
* New-ServiceNowIncident
121-
* New-ServiceNowSession
122-
* New-ServiceNowQuery
123-
* New-ServiceNowTableEntry
124-
* Remove-ServiceNowAttachment
125-
* Remove-ServiceNowTableEntry
126-
* Test-ServiceNowAuthIsSet
127-
* Update-ServiceNowChangeRequest
128-
* Update-ServiceNowIncident
129-
* Update-ServiceNowNumber
130-
* Update-ServiceNowRequestItem
131-
* Update-ServiceNowTableEntry
132-
13371
## Tests
13472

135-
This module comes with [Pester](https://github.com/pester/Pester/) tests for unit testing.
73+
This module comes with limited [Pester](https://github.com/pester/Pester/) tests for unit testing.
13674

13775
## Scope & Contributing
13876

139-
This module has been created as an abstraction layer to suit my immediate requirements. Contributions are gratefully received however, so please feel free to submit a pull request with additional features or amendments.
77+
Contributions are gratefully received, so please feel free to submit a pull request with additional features or amendments.
14078

14179
## Authors
14280

0 commit comments

Comments
 (0)