Node JS

My first exercise with SVG (Scalable Vector Graphics)

Posted on

Credits: Jessie Keck Mark Caron Two Segmented – DO-NUT PIE CHART   For my project which I am working on requires a pie-chart. So, I tried many options and thought SVG (Scalable Vector Graphics) may fit my need. Indeed, there can be multiple best solutions. But, I am some what happy as a IT Pro […]

Node JS

PUG Switch Case Statement Demo using Node JS and PowerShell

Posted on

A friend of mine asked a very good question “How can I use switch case statement in PUG using variable from route?” which took an hour time to figure it out! See the documentation for case statement here. I have a route like shown below app.get(“/”, function (request, response) { child = spawn(‘powershell.exe’, [“C:\\projects\\caseDemo\\scripts\\DayOfWeek.ps1”]) child.stdout.on(‘data’, […]

PowerShell

Download servicenow Incident attachment using PowerShell

Posted on

Of late I received a request to share a PowerShell script to download attachment(s) from the given servicenow incident. Two attachments are available for the sample incident INC0010008 below is the illustration. First we need to query incident by number to retrieve sys_id and through which we get the attachment metadata. Table name incident and table_sys_id are used respectively. […]

PowerShell

TIP: Using TrueSight QueryEventByID and RetrieveQueryResults Complex Types in PowerShell

Posted on

Recently I was working on piece of code which retrieves TrueSight alert information. I got stuck with “Invalid Long Type:” – Doesn’t make sense right? Come lets see it detail! Consider you have an alert ID like “mc.pncell_[HOSTNAME].1a5ed3bb.0” using the below snippet you can retrieve the result (resultHandle) param ( $AlertID ) try { $Url = […]

PowerShell

Tip: Retrieve servicenow CI item values using REST API (Turn on Display Value)

Posted on

In my last blog post I shared about ‘Scripted REST API’ getDisplayValue() tip. Now, here lets see Out of the Box option. When we query the CI with a query “sysparm_query=name=$($ConfigurationItem)&sysparm_limit=1” param ( $ConfigurationItem = ‘Car-3’ ) try { $Uri = “https://dev42835.service-now.com/api/now/table/cmdb_ci?sysparm_query=name=$($ConfigurationItem)&sysparm_limit=1” $admin = “admin” $password = “admin” | ConvertTo-SecureString -AsPlainText -Force $Credential = New-Object pscredential […]