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
# we aren't aware of this table, create default config
179
+
$thisTable=@{
180
+
Name=$Table
181
+
ClassName=$null
182
+
Type=$null
183
+
NumberPrefix=$null
184
+
DescriptionField=$null
185
+
}
186
+
}
187
+
}
188
+
176
189
if ( $Id ) {
177
190
if ( $Id-match'[a-zA-Z0-9]{32}' ) {
178
-
if ( $PSCmdlet.ParameterSetName-eq'Id' ) {
191
+
if ( -not$thisTable ) {
179
192
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
193
}
181
-
194
+
182
195
$idFilter=@('sys_id','-eq',$Id)
183
196
}
184
197
else {
185
-
if ( $PSCmdlet.ParameterSetName-eq'Id' ) {
198
+
if ( -not$thisTable ) {
186
199
# 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', '))
0 commit comments