PowerTip: Turn off the power to your computer with PowerShell

Summary: A simple way to power off your computer by using the Windows PowerShell cmdlets.    Hey, Scripting Guy! I’ve got a script that needs to power off a system after it’s done. How can I accomplish this with PowerShell?    Look no further than the Stop-Computer cmdlet to turn off the power! (How’s THAT…


Parse HTML and pass to Cognitive Services Text-to-Speech

Summary: Having some fun with Abbott and Costello’s “Who’s on first?” comedy routine, and multiple voices with Bing Speech. ——————————- Hello everyone! The last few posts, I showed you all about the Cognitive Services Text-to-Speech API. You learned about the process to authenticate with Windows PowerShell. It was also a great showcase for Invoke-RestMethod, as…


PowerTip: Determine your version of PowerShell and host operating system

Summary:  Identify your PowerShell environment by making use of built-in PowerShell variables.    Hey, Scripting Guy! If I’m writing a script, how can I detect if I am running on Windows, Linux, or Mac with PowerShell?    Just use the built-in variable $PSVersionTable, which has all of the properties you’ll need. Here is an example:…


Windows PowerShell and the Text-to-Speech REST API (Part 5)

Summary: Send and receive content to the Text-to-Speech API with PowerShell. Q: Hey, Scripting Guy! Could you give a buddy a hand in getting the last pieces together for the Text-to-Speech API? —SR A: Hello SR, No problem at all. The last few posts, we dealt with the “Heavy Lifting” (which really wasn’t that heavy):…


PowerTip: Use PowerShell to play WAV files

Summary: Make use of the native features of Windows through PowerShell to play sound.    Hey, Scripting Guy! I’ve got some WAV files I would love to play without launching an application. Is there a way in Windows PowerShell to do this?      You sure can! Using the System.Media.Soundplayer object, you can do this…


Windows PowerShell and the Text-to-Speech REST API (Part 4)

Summary: Send and receive content to the Text-to-Speech API with PowerShell. Q: Hey, Scripting Guy! I was playing with the Text-to-Speech API. I have it almost figured out, but I’m stumbling over the final steps of formatting the SSML markup language. Could you lend me a hand? —MD A: Hello MD, Glad to lend a…


PowerTip: Ensure that errors in PowerShell are caught

Summary: Here’s how to make sure your errors get caught with Try Catch Finally.    Hey, Scripting Guy! I’ve been trying to use the Try Catch Finally, but some of my errors aren’t getting caught. What could be the cause?    For Try Catch Finally, you need to make sure the error defaults to a…


Windows PowerShell and the Text-to-Speech REST API (Part 3)

Summary: Use Windows PowerShell to access the Cognitive Services Text-to-Speech API. Q: Hey, Scripting Guy! I was reading up on how we could use PowerShell to communicate with Azure to gain an access token. I’ve been just itching to see how we can use this! Would you show us some examples of this in use…


Run PowerShell code in Puppet

Summary: Hi everyone, Dan Franciscus here. I’m a systems engineer and freelance technical writer based out of New Jersey. My expertise is in Windows Server, PowerShell, VMware, and Puppet. Puppet is an infrastructure platform that helps automate your environment. While Puppet has a large Linux user base, it also supports the configuration of Windows systems….