Play with Speech Synthesizer using PowerShell and Node JS

This blog post is to demo the speech synthesizer using PowerShell. What’s new? Well nothing, except blending the PowerShell script with Node JS. To know about Speech Synthesizer refer MSDN – Reference for PowerShell is captured in idera PowerShell Tip (Speech-Week) Yes, this reminded a project I delivered for one of our Dutch customer!

Now, it’s time to click and convert text to speech! Let’s make it as simple as possible! The speech page is illustrated below!

PowerShell Script

Pretty straight forward! The script accepts a parameter $Text and we pass value from our node web application.


We have created two routes i.e GET and POST for ‘/Speech’ where the GET renders the speech.pug and POST calls the PowerShell script. Closer look to pass the value for the PowerShell parameter


Use your favorite bootstrap to make your web application glossy! See you all in my next blog post! Enjoy PowerShell!

Retrieve Oracle instance port number using PowerShell | REGEX

A requirement popped up to get the Oracle instance(s) port number before building a connection string for establishing a connection. Team used tnsping utility which returns results like shown below

We need to get the port number – Which is really a very straight forward approach using regular expression


Result : PORT = 15210


Play with PowerShell DateTime – Orchestrator Conditional Wait!

A colleague asked me a script to trigger an event on 5th business day from the date of submission.

Changing the script condition for management is hell! We need reminder in one business day, no well make it two! Hang on, keep it for 5 business day!

Here is the requirement! When user submit a request form it sends form details to third party orchestrator where the logical flow is built and codes are injected in palette for enacting the request. In a given requirement team should fire a reminder email on 5th business day! For example, today is 3/8/2018 adding 5 days to it give 3/13/2018 and excluding weekends i.e Saturday and Sunday it’s 3/15/2018 which is the 5th business day!

There are plenty of articles over internet which demonstrates the DateTime class in PowerShell. So, nothing new I can share expect this extension 🙂

Find next business for given day

In our case we need to find 5th business day but it’s business process right it may change often! Here is the sample code!

returns Wednesday, February 28, 2018 11:46:10 AM 

Parameterization – Just change as required!

Wednesday, February 28, 2018 11:54:33 AM


Indeed, many moved to SNOW (servicenow) and enjoying it where in few customers are still using legacy products! In my work place snow is in proof of concept stage. Like many automation enthusiast I love to explore both REST and SOAP for solving customer requirements. In this article I will walk you through the steps to consume HPSM soap web service and publish it as REST end points.

If you aren’t new to PowerShell then you must have come across the Hey Scripting Guy Post – Use PowerShell to retrieve a weather forecast!  Yes, nothing much I will explain here and in fact I follow the same foot-steps for our PowerShell script to work with HPSM SOAP Web Service.

To begin with let us explore the PowerShell script to query incidents by ID. Here the ID is valid HPSM incident ID which has a format like IM12345

Cool! It works and for now don’t worry about performance. We have plenty of ways to fine tune this code which will be covered in my next upcoming blogs!

Node Application

It’s time for us to build a node application and distribute the solution as REST endpoint in on premise server. Yes, the HPSM web service we used is cloud hosted application and managed by third party vendor(s).

Using the built in module ‘child-process’ we called PowerShell.exe and passed the script file path as argument. That’s it! Rest is our fruitful result!

Output is as shown below

Using Express Framework

In the preceding example we successfully got the output in the console. Now, we need to get this working in our web server. After a bit of trial and error I figured out the easier method!

Browse to http://localhost:3000 to see the result


If you observed the code carefully we used static value for the incident ID. So we need to tweak our code little bit! Just parameterize your PowerShell script as illustrated below

And your server.js will look like below

It’s really simple! Browse to http://localhost:3000/incidentid/IM12345 to see the same result 🙂

Deploy it as Windows Service

For this I used qckwinsvc.cmd which is really very handy. After installing the qckwinsvc from npm globally – Just use it

Now our service is up and running


Change BMC TrueSight Slot Values Using SOAP and PowerShell

BMC TrueSight – An Aerial View!!!

While working on Event Management a requirement popped up “Update TruSight the slot value when orchestrator automates the event(s)”. In short the automation agent should close the alert after auto-healing. I expected a REST endpoint but unfortunately SOAP web service was the only option.

To solve this we have to take five steps approach connect, map the mc_ueid, manipulate, update using SendEvent operation and disconnect. Yes, it’s that easy!

Establish the Connection

Map mc_ueid

Manipulate status

Update Using SendEvent

Disconnect (Do bulk operation and call disconnect)

Enjoy PowerShell 🙂