• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Think PowerShell

Think PowerShell

PowerShell for IT Pros

  • About
    • Who I Am
    • Why I Blog
    • Privacy Policy
  • Resources
    • More PowerShell Sites
    • Post Series Index
  • Get Help
  • Show Search
Hide Search

Script

PowerShell Splatting: What is it, Why Use It

Aaron Rothstein · October 17, 2017 · 5 Comments

Splatting with a hash table.
Splatting with a hash table.

Make your PowerShell scripts easier to read with splatting.

No one likes horizontal scrolling

The format of PowerShell cmdlets make them universally easy to use. Enter the cmdlet name, then enter the various parameter switches and values for those parameters. For a lot of commands, everything can fit cleanly on one line and within either the standard 80 character width of a standard prompt or the full screen width of your favorite editor.

However, there are going to be times you want to specify a LOT of parameters, and some of those parameter values may be lengthy in nature. The last thing you want to do though is have to start scrolling sideways or trying to wrap your “one-liner” to read it.

[Read more…] about PowerShell Splatting: What is it, Why Use It

Create Cortana Audio Files From Text Using PowerShell

Aaron Rothstein · July 17, 2017 · 2 Comments

A WAV file generated from PowerShell.

Use Windows 10’s Text-to-Speech capability and Cortana’s voice to create WAV audio from within a PowerShell script.

Finding a Universal Voice: A Universal Problem

Have you ever called a support line and had to listen to a bunch of different recorded scripts, also known as “prompts”? The prompts may be the voice of a single person or a combination of different people (maybe the original voice left the company). There may be feedback noise on the recording. The speaker may have tripped over a word but decided not to record the prompt over again. Maybe the speaker had a cold one the day of recording. All of these factors can create an inconsistent user experience when interacting with the call prompts. If that weren’t enough, it takes TIME to record prompts manually! The more you have the longer it will take, even if you get every recording right on the first try.

Wouldn’t it be great if there was a way to audio files with a consistent voice, and in an efficient manner? We can, with PowerShell and Windows 10’s Text-to-Speech capability, powered by the .NET class SpeechSynthesizer.

[Read more…] about Create Cortana Audio Files From Text Using PowerShell

PowerShell Script to Empty Recycle Bin at Logoff

Aaron Rothstein · July 6, 2016 · 3 Comments

Windows Recycle Bin
Windows Recycle Bin

Automate the emptying of the Windows Recycle Bin with this simple PowerShell script and Group Policy.

Redirected Folders = Recycle Bin Storage on File Server

In a lot of business environments, we redirect user folders like Documents, Desktops, Favorites, and more to a home directory on a network share, often mapped to its own drive letter. The folders are then synced to the user’s workstation to be available offline. This gives the user the ability to work on the files when disconnected, but still allows IT to have the files stored on the file servers and backed up.

[Read more…] about PowerShell Script to Empty Recycle Bin at Logoff

Primary Sidebar

Aaron

Think PowerShell

Copyright © 2025 · Monochrome Pro on Genesis Framework · WordPress · Log in