When you use double quotes in PowerShell, you can add variables to a string, and PowerShell automatically replaces these with their content –...
Powershell
Synthesizing Speech – Using Different Voices (Part 4)
Windows 10 comes with excellent text-to-speech support and different high-quality voices. To find out which voices are available, try this: Add-Type...
Synthesizing Speech – Using Speech Synthesis Markup Language SSML (Part 3)
Windows built-in text-to-speech engine accepts plain text and turns it into a voice, but it can also be controlled using “Speech Synthesis Markup...
Synthesizing Speech – Recording to File (Part 2)
In the previous tip we introduced the text-to-speech engine. This engine can save your text to a WAV sound file so you can use it to generate spoken...
Synthesizing Speech (Part 1)
In the previous tips, we explained how PowerShell can generate acoustic signals by playing system sounds or WAV sound files. PowerShell can also use...
Playing Sound Files
In the previous tip we explained how PowerShell can play system sounds. For a bit more flexibility, PowerShell can also play arbitrary *.wav sound...
Playing Sounds
If all you need is a beep, then PowerShell can help you easily: $frequency = 800 $durationMS = 2000 [console]::Beep($frequency, $durationMS) If...
Sort IPv4 and IPv6 Addresses Correctly
When you try and sort IPv4 addresses via Sort-Object, this fails: PS> '10.1.2.3', '2.3.4.5', '1.2.3.4' | Sort-Object 1.2.3.4 10.1.2.3 2.3.4.5...
Sort IPv4 Addresses Correctly
In the previous tip we published a super-fast function called Test-OnlineFast, and this function was able to ping an entire IP segment in record...
Final Super-Fast Ping Command
In the previous tip series, we developed a new function called Test-OnlineFast that can ping multiple computers in record time. For some reason, the...
Backing Up Event Logs
There are a number of useful cmdlets to manage event logs, however one functionality is missing: PS> Get-Command -Noun EventLog CommandType Name...
Converting a Windows Error ID into Friendly Text
When you call low level functions from PowerShell, often you get back a numeric return value. If the return value came from a Windows API function,...
Finding Registered Event Log Source Names
When you write events to an event log using Write-EventLog, you must specify a valid source name. However, there is no easy way of finding out which...
Easy Logging by Using Event Logs
Often scripts need to log what they do, and PowerShell scripters invest a lot of thought and time on logging information to text files. As an...
Uncover Tiny URLs
Tiny URLs like “http://bit.ly/e0Mw9w” are short and convenient to use, however they often mask the true origin as well. PowerShell can...
Automatic Wallpaper Downloader
Are you tired of boring wallpapers for your desktop? PowerShell can get you new wallpapers! Here’s the function: function Download-Wallpaper { param...
Saving Values to Excel Sheet
Occasionally, you may have to update values in an Excel spreadsheet. PowerShell can access the Excel object model however this is quite slow. Here...
Reading Excel Cells
Occasionally, you may have to read information from Excel spreadsheets. PowerShell can access the Microsoft Excel object model albeit it is quite...
Permanently Setting Environment Variables
PowerShell can set environment variables only in its process set, so these changes will not persist and are not visible outside of PowerShell. To...
Select-Object and -ExcludeProperty
Here is a line of code that often puzzles PowerShell users: Get-Service | Select-Object -ExcludeProperty Name When you use Select-Object, its...
Forcefully Close All PowerShell ISE Documents
Here’s a code snippet that forcefully closes all open documents in the PowerShell ISE. Be aware: it closes all documents without asking to...
Creating Highspeed Ping (Part 6)
In the final part of our mini-series, we add pipeline awareness to our super-fast Test-OnlineFast function. You now can pipe computer names into the...
Creating Highspeed Ping (Part 5)
In the previous tip we created a lightning fast new PowerShell function called Test-OnlineFast which used WMI to ping any number of computers with...
Creating Highspeed Ping (Part 4)
In the previous tip we illustrated how WMI can ping multiple computers in a very fast way. So today, let’s wrap the code into a reusable...