Skip to content

Commit c20f2f5

Browse files
committed
old cred cleanup, help updates
1 parent 7c1f3ab commit c20f2f5

10 files changed

+24
-18
lines changed

CHANGELOG.md

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
## 3.0
2+
- This is a big update and one that preps us for the future (in my opinion and hopefully :smile:). I've tried to limit the breaking changes, but there are some at the bottom of the list. As always, any feedback is truly appreciated.
3+
- New functionality in `Get-ServiceNowRecord`
4+
- Add `Id` property to easily retrieve a record by either number or sysid.
5+
- Add `ParentId` property to easily retrieve records based on the parent number or sysid. For example, to retrieve catalog tasks associated with a requested item execute `Get-ServiceNowRecord -ParentId RITM01234567`.
6+
- Add `Description` property to retrieve records based on a table specific description field. For many tables this field will be short_description, but will be different for others. For example, when performing this against the 'User' table, the description field is 'Name'.
7+
- Add ability to provide a known prefixed `Id` without providing `Table`, `Get-ServiceNowRecord -Id inc0010001`. To see the list of known prefixes, execute `$ServiceNowTable.NumberPrefix` after importing the module.
8+
- Add alias `gsnr`. With the above change, a Get can be as simple as `gsnr inc0010001`.
9+
- Add autocomplete for `Table` parameter in `Add-ServiceNowAttachment` and `Get-ServiceNowAttachment`.
10+
- Add `Id` parameter to `Add-ServiceNowAttachment` and `Update-ServiceNowRecord` which accepts either number or sysid. Just as with `Get-ServiceNowRecord` you can now provide just `Id` if it has a known prefix.
11+
- Add ability to `Get-ServiceNowAttachment` to get attachments either via associated record or directly from the attachments table when you want to search all attachments.
12+
- Add advanced filtering and sorting functionality to `Get-ServiceNowAttachment` which can be really useful when searching across the attachments table.
13+
- Convert access and refresh tokens in $ServiceNowSession from plain text to a credential for added security.
14+
- Pipeline enhancements added in many places.
15+
- Add Change Task and Attachments to formats.
16+
- `Update-ServiceNowNumber` has been deprecated and the functionality has been added to `Update-ServiceNowRecord`. An alias has also been added so existing scripts do not break.
17+
- Prep for removal of all `Get-` functions except for `Get-ServiceNowRecord` and `Get-ServiceNowAttachment`. Table specific Get functions have been deprecated. `Get-ServiceNowRecordInterim` has been created and all table specific Get functions have been aliased so existing scripts do not break. Please start to migrate to `Get-ServiceNowRecord` as these functions will all be deprecated in the near future.
18+
- As communicated in v2.0, authentication cleanup has occurred. This involves removal of Credential/Url authentication in each function in favor of `ServiceNowSession`. You can still authenticate with Credential/Url, but must use `New-ServiceNowSession`. `Set-ServiceNowAuth`, `Remove-ServiceNowAuth`, and `Test-ServiceNowAuthIsSet` have been deprecated.
19+
- ***Breaking change:*** rename `Get-ServiceNowAttachmentDetail` to `Get-ServiceNowAttachment`.
20+
- ***Breaking change:*** rename `Get-ServiceNowAttachment` to `Export-ServiceNowAttachment`.
21+
- ***Breaking change:*** `Get-ServiceNowTable` and `Get-ServiceNowTableEntry` have been deprecated. Use `Get-ServiceNowRecord`.
22+
123
## 2.4.2
224
- Fix [#141](https://github.com/Snow-Shell/servicenow-powershell/issues/141), add `UseBasicParsing` to all API calls to keep AA from failing when IE hasn't been initialized
325

ServiceNow/Public/Add-ServiceNowAttachment.ps1

-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ Function Add-ServiceNowAttachment {
5151
[Alias('sys_id', 'SysId', 'number')]
5252
[string] $Id,
5353

54-
# [Parameter(ParameterSetName = 'AutomationNumber', Mandatory)]
55-
# [Parameter(ParameterSetName = 'SessionNumber', Mandatory)]
56-
# [string] $Number,
57-
5854
[Parameter(Mandatory)]
5955
[ValidateScript( {
6056
Test-Path $_

ServiceNow/Public/New-ServiceNowChangeRequest.ps1

-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ function New-ServiceNowChangeRequest {
156156
Table = 'change_request'
157157
Values = $TableEntryValues
158158
Connection = $Connection
159-
Credential = $Credential
160-
ServiceNowUrl = $ServiceNowURL
161159
ServiceNowSession = $ServiceNowSession
162160
}
163161

ServiceNow/Public/New-ServiceNowIncident.ps1

-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ function New-ServiceNowIncident {
128128
Table = 'incident'
129129
Values = $TableEntryValues
130130
Connection = $Connection
131-
Credential = $Credential
132-
ServiceNowUrl = $ServiceNowURL
133131
ServiceNowSession = $ServiceNowSession
134132
}
135133

ServiceNow/Public/Remove-ServiceNowAttachment.ps1

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ Function Remove-ServiceNowAttachment {
4646
Method = 'Delete'
4747
UriLeaf = "/attachment/$SysId"
4848
Connection = $Connection
49-
Credential = $Credential
50-
ServiceNowUrl = $ServiceNowURL
5149
ServiceNowSession = $ServiceNowSession
5250
}
5351

ServiceNow/Public/Remove-ServiceNowRecord.ps1

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ function Remove-ServiceNowRecord {
2323
Table = $Table
2424
SysId = $SysId
2525
Connection = $Connection
26-
Credential = $Credential
27-
ServiceNowUrl = $ServiceNowURL
2826
ServiceNowSession = $ServiceNowSession
2927
}
28+
3029
Invoke-ServiceNowRestMethod @params
3130
}

ServiceNow/Public/Update-ServiceNowChangeRequest.ps1

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ function Update-ServiceNowChangeRequest {
3535
SysId = $SysId
3636
Values = $Values
3737
Connection = $Connection
38-
Credential = $Credential
39-
ServiceNowUrl = $ServiceNowURL
4038
ServiceNowSession = $ServiceNowSession
4139
}
4240

ServiceNow/Public/Update-ServiceNowIncident.ps1

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ function Update-ServiceNowIncident {
3131
SysId = $SysId
3232
Values = $Values
3333
Connection = $Connection
34-
Credential = $Credential
35-
ServiceNowUrl = $ServiceNowURL
3634
ServiceNowSession = $ServiceNowSession
3735
}
3836

ServiceNow/Public/Update-ServiceNowRequestedItem.ps1

-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ function Update-ServiceNowRequestItem {
5353
SysId = $SysId
5454
Values = $Values
5555
Connection = $Connection
56-
Credential = $Credential
57-
ServiceNowUrl = $ServiceNowURL
5856
ServiceNowSession = $ServiceNowSession
5957
}
6058

ServiceNow/ServiceNow.psm1

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ $tableArgCompleterSb = {
1919
@(
2020
'Get-ServiceNowRecord',
2121
'Get-ServiceNowAttachment'
22+
'Add-ServiceNowAttachment'
2223
) | ForEach-Object {
2324
Register-ArgumentCompleter -CommandName $_ -ParameterName 'Table' -ScriptBlock $tableArgCompleterSb
2425
}

0 commit comments

Comments
 (0)