Monday, April 27, 2015

Make your PowerShell Script SPEAK : Use VOICE notifications in your PowerShell scripts.

 

Picture1

 

Who said, that only artists are creative?

We the coders are creative too. We use the white canvas of ISE and use the “Cmdlets” to write our own poetry, draw our imagination on it.

Believe me, we are really creative.

Anyway, It’s an era of “Voice Enabled” personal assistants.

Microsoft had introduced the “Cortana” in Windows 8.1 phones and in the Desktop version of Windows 10, is also containing “Cortana”, She speaks.

Do you know, we can make our PowerShell scripts to “Speak” too? Wondering how?

 

By using the SAPI.SpVoice com object.

SAPI means = Speech Application Programming Interface.

To use the SAPI voice engine, we need to create a new com object and save it to the variable.

$talkIt = New-Object -ComObject SAPI.SpVoice

In the above command, we are creating a new SAPI.SpVoice Object.

Our new $talkIt object has a method name SPEAK( ). Now we can, make our PowerShell scripts speak whatever we like them to say.

$talkIt.speak("Dear $env:Username the time is Date and time is $(get-date)"

In the above code, the script will speak my name and the current data and time, and everything is dynamic, nothing is hardcoded.

you can even see, that’s is very easy to use in-built environment variables and script blocks too.

$talkIt = New-Object -ComObject SAPI.SpVoice

$talkIt.speak("Dear $env:Username the time is Date and time is  is $(get-date)")

Try the code now and enjoy it.

 Cortana

Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.

 


 

Sunday, April 19, 2015

Join me at Microsoft User Group's event "Connect (Delhi);"


11082576_953623508011442_2289391193647231755_n
Microsoft User Group Delhi, in organising a "Connect (Delhi)" Chapter.
I am giving two sessions over there, If you are in Delhi and want to join my session Smile get the passes and  join me .
11169922_964570023583457_8597756949257079680_n
Agenda
9:30 am to 10:00 am
Keynote
10:00 am to 11:00 am
Introduction to Windows PowerShell
11:00 am to 12:00 pm
.NET Fundamentals
12:00 pm to 1:00 pm
SharePoint and Smart Cities
1:00 pm to 2:00 pm
Lunch
2:00 pm to 2:30
AppStudio: Dev without coding
2:30 pm to 3:30 pm
SQL Azure
3:30 pm to 4:30 pm
Surving in a MNC
4:30 pm to 5:00 pm
Q/A Session
Register here for the event : https://www.facebook.com/events/649362308501421/
giphy
Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.