Skip to content

ServiceNow module working over pwsh Linux #167

Closed
@gdbarron

Description

@gdbarron

Discussed in #166

Originally posted by pheresparza November 26, 2021
Hello everyone,

Just wonder if any of you guys have got this amazing module working over PowerShell for Linux, I was able to install it however, when try to use it, I get errors that I do not get under Windows OS instance of PowerShell.

ie:

InvalidOperation: /root/.local/share/powershell/Modules/ServiceNow/3.1.2/Public/Get-ServiceNowRecord.ps1:198
Line |
198 | … re-Object { $.Name.ToLower() -eq $Table.ToLower() -or $.ClassName.T …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.

InvalidOperation: /root/.local/share/powershell/Modules/ServiceNow/3.1.2/Private/Invoke-ServiceNowRestMethod.ps1:81
Line |
81 | … re-Object { $.Name.ToLower() -eq $Table.ToLower() -or $.ClassName.T …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.

Exception: /root/.local/share/powershell/Modules/ServiceNow/3.1.2/Public/New-ServiceNowQuery.ps1:156
Line |
156 | … throw ('Operator ''{0}'' is not valid' -f $thisFilter[1]) …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Operator '-eq' is not valid

when trying this one:

$filter = @('cat_item', '-eq','eeec211f0f1006007fbd317ce1050e5e')
Get-ServiceNowRecord -Table sc_cat_item -Filter $filter

NOTE: ServiceNow session was done prior run above.

Thanks in advance.

Juan Fernando Esparza

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions