Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chelseyful/psglide
PowerShell module designed to bring native-feeling Glide API elements to PowerShell
https://github.com/chelseyful/psglide
powershell-core powershell-module servicenow
Last synced: about 2 months ago
JSON representation
PowerShell module designed to bring native-feeling Glide API elements to PowerShell
- Host: GitHub
- URL: https://github.com/chelseyful/psglide
- Owner: chelseyful
- License: gpl-3.0
- Created: 2019-07-26T17:01:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-07T16:59:56.000Z (about 5 years ago)
- Last Synced: 2024-11-15T11:08:08.110Z (about 2 months ago)
- Topics: powershell-core, powershell-module, servicenow
- Language: PowerShell
- Size: 38.1 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# PSGlide - PowerShell interface to NOW API
[![Build status](https://ci.appveyor.com/api/projects/status/h3s1hbmnj6qvotc5/branch/master?svg=true)](https://ci.appveyor.com/project/chelseyful/psglide/branch/master)## Summary
This module aims to emulate the Server-Side Glide API within PowerShell.
Allowing you to query a ServiceNow instance with code that feels like the
native Glide API.The module does this by replicating the various script includes that comprise
the server-side API, such as GlideRecord.## Requirements
- One of;
- Windows PowerShell 5.0 or later
- PowerShell Core 6.0 or later
- All of
- A ServiceNow instance with the NOW REST API
- A username and password pair with API access## Installation
### Windows
You may install the module system-wide, or for a particular user. Select one of
the following paths for your use case.- Install for all users
- %ProgramFiles%\WindowsPowerShell\Modules
- For a specific user
- %UserProfile%\Documents\WindowsPowerShell\Modules
- *NOTE:* You may beed to creaate this folder yourself### Linux
Depending on your use case; copy the PSGlide folder to one of
these locations.- All users
- /opt/microsoft/powershell/6/Modules/
- *NOTE:* Might not be a best practice to install 3rd party modules here
- Specific user
- ~/.local/share/powershell/Modules## Usage
Load the module with the `using` keyword to ensure the classes are available
in the current namespace.```
using module PSGlide
```Configure the connection to your ServiceNow instance by creating a new
GlideFactory. This new object will generate all the bits and pieces you would
expect from the Glide APIIn the following example; assume your instance URL is; contoso.service-now.com
```
$credentials = Get-Credential
$myServer = [GlideFactory]::new('contoso', $credentials)
```Spin up a new GlideRecord and start getting those wonderful rows!
```
$grTask = $myServer.newGlideRecord('task')
$grTask.addQuery('active','true')
$grTask.setLimit(1)
$grTask.query()
if ($grTask.next()) {
$grTask.getValue('number') | Write-Host
}
```