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….


Get certificate info into a CSV by using PowerShell

Summary: Certificate management is always challenging. Let’s explore how to use PowerShell to export local certificate information to a comma-separated values (CSV) file on Windows 7 (or later) computers. Q: Hey, Scripting Guy! How can I get all my certificate info into a CSV on my Windows computers? —SH A: Hello SH, Patrick Mercier here,…


Introducing the DscLcm utility for PowerShell

Summary: Desired State Configuration is a great deployment tool to meet your organization’s infrastructure-as-code goals. I recently came across a situation for a project that uses the Push Service (as opposed to the Pull Service). It required me to be able to apply a new partial configuration to a node, without any knowledge of what…