Powershell script to to test simple lis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Normalzies exception string for logging | |
* @param {Exception} e | |
* @returns {string} message | |
* @private | |
*/ | |
{ | |
_formatErrorMessage: function (e) { | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------------*/ | |
/* */ | |
/* Have a bunch of apps that need to be updated? */ | |
/* Run this and follow the directions in the output */ | |
/* It will build a payload and use the CI/CD API to */ | |
/* run a batch install of all of the needed updates. */ | |
/* */ | |
/*----------------------------------------------------*/ | |
//Want Demo Data with the app? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @namespace cf_HTMLTableParser | |
* @description A module for parsing HTML tables into an array of objects. | |
*/ | |
var cf_HTMLTableParser = (function () { | |
var logger = new GSLog('', "cf_HTMLTableParser"); | |
/** | |
* Parses HTML tables into an array of objects. | |
Example Structure of an HTML document with two tables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Takes a nested object and flattens its to one level. Function recursively calls itself until finished. | |
* //https://stackoverflow.com/questions/34513964/how-to-convert-this-nested-object-into-a-flat-object | |
* @public | |
* @param {Object} currentNode - Current node in the nested object to process | |
* @param {object} flattenedObject - The new object containing the flattened values | |
* @param {object} flattendKey - The current flattened key name. Example: key.key1.key2 | |
* @returns {Object} | |
* @example var testObj = { | |
"key1" : "test1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a new GlideRecord Object from inputs, calls query(), then retuns the Object | |
* @private | |
* @param {object} options - Object containing table and any gliderecord methods to call | |
* @returns {GlideRecord} | |
* @example | |
* var options = { | |
* "table": "cmdbi_ci_computer", | |
* "methods": { | |
* "addEncodedQuery": "active=true", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieves active user sessions and associated nodes for a list of user IDs. | |
* | |
* @param {string[]} userIDs - An array of user IDs for which to retrieve active sessions. | |
* @returns {Object[]|undefined} - An array of session and node information, or undefined if no active sessions are found. | |
*/ | |
function cf_getActiveUserSessions(userIDs) { | |
/** | |
* Internal function to get active sessions for given user IDs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Used to validate arguments passed into methods. | |
*/ | |
var argumentValidation = Class.create(); | |
argumentValidation.prototype = { | |
initialize: function(logLevel) { | |
this.logger = new global.GSLog('cf.argumentValidation.log.level'); | |
if (this.notNil(logLevel)) { | |
logger.setLevel(logLevel); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f1(a) { | |
gs.info("Hello " + a); | |
return gs.now(); | |
} | |
function f2(a) { | |
gs.info("The date is: " + a); | |
return 70; | |
} | |
function f3(a) { | |
gs.info("The temperature is " + a + " degrees"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* NOTE; This is a work in progress and has not been tested in its current form. | |
* Set of methods to simplify loading data into ServiceNow. Use with Inbound Email, rest, etc... | |
* A temporary DS/importset will be created for the data load. It will be removed if the cleanup method is called. | |
* Example usage: DataTransformUtils().getDataSourceByName('Test DataSource').copyDataSource().copyAtt(sourceRecord).loadData().getMapByName('Test Transform Map').importData().cleanUpImport().log(); | |
* this will: | |
* 1. Retrieve Existing DS by name | |
* 2. Create a clone of this datasource | |
* 3. Copy attachments from a source record to copied datasource | |
* 4. load data from the datasource into the import set table |
NewerOlder