You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
## 3.0.1
2
+
- Fix [#149](https://github.com/Snow-Shell/servicenow-powershell/issues/149), combination of `-Id` and `-IncludeCustomVariable` failing. Thanks @natescherer.
3
+
- Fix [#150](https://github.com/Snow-Shell/servicenow-powershell/issues/150), Test-ServiceNowURL does not account for URL with a - character. The validation wasn't providing much value so was removed.
4
+
- Getting info on all tables so we can be more intelligent/dynamic about prefixes. Querying the sys_number table and might require elevated rights. If rights aren't present, no failure will occur, this is just an added bonus for those with rights :)
5
+
1
6
## 3.0
2
7
- New functionality in `Get-ServiceNowRecord`
3
8
- Add `Id` property to easily retrieve a record by either number or sysid.
# we aren't aware of this table, create default config
199
+
$thisTable=@{
200
+
Name=$Table
201
+
ClassName=$null
202
+
Type=$null
203
+
NumberPrefix=$null
204
+
DescriptionField=$null
205
+
}
206
+
}
207
+
}
208
+
176
209
if ( $Id ) {
177
-
if ( $Id-match'[a-zA-Z0-9]{32}' ) {
178
-
if ( $PSCmdlet.ParameterSetName-eq'Id' ) {
210
+
if ( $Id-match'^[a-zA-Z0-9]{32}$' ) {
211
+
if ( -not$thisTable ) {
179
212
throw'Providing sys_id for -Id requires a value for -Table. Alternatively, provide an Id with a prefix, eg. INC1234567, and the table will be automatically determined.'
180
213
}
181
214
182
215
$idFilter=@('sys_id','-eq',$Id)
183
216
}
184
217
else {
185
-
if ( $PSCmdlet.ParameterSetName-eq'Id' ) {
218
+
if ( -not$thisTable ) {
186
219
# get table name from prefix if only Id was provided
throw ('The prefix for Id ''{0}'' was not found and the appropriate table cannot be determined. Known prefixes are {1}. Please provide a value for -Table.'-f$Id, ($ServiceNowTable.NumberPrefix.Where( { $_ }) -join', '))
193
225
}
194
226
}
@@ -201,14 +233,14 @@ function Get-ServiceNowRecord {
201
233
else {
202
234
$invokeParams.Filter=$idFilter
203
235
}
236
+
204
237
}
205
-
else {
206
-
# table name was provided, get the config entry if there is one
0 commit comments