Why Use Source Control

Why Use Source Control

Source control, whether you’re writing one off scripts or automating intricate processes, is essential to your work. Simply keeping copies of your files scattered across your computer is not good enough. Source control will save you when you can’t figure out what changes you made that caused errors, when you can’t find the current version of your script, or when you have to work with a co-worker on you need to collaborate. Tracking Changes First and foremost, you want to…

Read More Read More

Turn Off PSReadline

Turn Off PSReadline

Beginning with Windows Management Framework 5 Microsoft decided to ship Pester and PSReadline baked into the framework. Pester is a testing framework and PSReadline is a handy utility that brings some bash functionality to the PowerShell console. PSReadline brings syntax highlighting and amazing multi-line editing to the console and I don’t know if I could go without. Alas, not all modules are right for all people so we’re going to go and figure out how to remove PSReadline. First, we…

Read More Read More

PSPushover

PSPushover

I just recently published a module to the PowerShell Gallery called PSPushover and it couldn’t have been easier. Pushover.net is an alerting service I use to notify me of different events through IFTTT and I wanted a way to send off alerts from my PowerShell scripts. Some of my scripts are long running and I’d like to know whether it finished in error or not. I plan on providing better help and better documentation in the README.md but otherwise I’m…

Read More Read More

Pipelines and Objects

Pipelines and Objects

Two strong points of PowerShell are the ability to work with Pipelines and Objects. PowerShell is built on top of .NET and has the ability to work with .NET objects as well as sending and receiving information from the pipeline. Objects To developers, asking them to go from an object based language to one that parses text for input/output would get you laughed at. That is exactly why when Microsoft decided to write a new console and scripting language they…

Read More Read More

Get Involved in PowerShell

Get Involved in PowerShell

I got a secret for you. The PowerShell community needs your voice. Your perspective on things. You might think that the community has enough talented people out there but you’d be wrong. It is time to get involved. The truth is, PowerShell has gotten big. Really big. It now covers the console shell, desired state configuration, and nearly every Microsoft product. Heck, with Nano server you’ll be expected to configure it using PowerShell remoting. It doesn’t matter how talented the…

Read More Read More

Formatting Output

Formatting Output

Formatting output from cmdlets doesn’t have to be complicated. PowerShell ships with cmdlets that can take the output from other cmdlets and display the information in a pretty way. Format-Custom, Format-List, Format-Table, and Format-Wide are the ways to present data at the console. Out-Default Out-Default is a cmdlet you likely have never heard of but rely on whenever you spit an object to the console. Out-Default is the cmdlet that figures out which way to format the information you have…

Read More Read More

Email

Email

I don’t mind getting emails from readers but I do however mind if my personal email gets spam. So, I’m taking a page out of [Mike F. Robbins](http://mikefrobbins.com/about/)‘s book and have encoded my email in base64. `bgBnAGUAdABjAGgAZQBsAGwAQABnAGUAdABjAGgAZQBsAGwALgBvAHIAZwA=` Figure out how to convert that to an email address using PowerShell and I’ll love to hear from you. Make sure to include the code you used as there is more than one way to accomplish this.

Introduction to Cmdlets

Introduction to Cmdlets

For years Microsoft has played a trick on systems administrators. They convinced you that you could administer Windows Servers at the same scale that Linux administrators could. While that sentiment is true the tooling wasn’t always geared towards system administrators. You had MS-DOS and batch files that you could use to automate anything you could do at the command line as well as VB scripts for more programmatic automation. The trouble is, batch lacks an interface into most of the…

Read More Read More

Introduction: PowerShell Direct

Introduction: PowerShell Direct

PowerShell Direct is a new feature to Windows Management Framework version 5 that allows for Windows hosts to run PowerShell commands against a Hyper-V guest. Think of this as PowerShell Remoting without the need to enable remoting on the guest operating system. Your guest doesn’t have to configure the firewall to allow for remoting. You don’t even need a network card. Instead of the Hyper-V rolling out their own PowerShell Direct remoting tool Microsoft opted to integrate PowerShell Direct into…

Read More Read More

Credentials

Credentials

Have you ever tried running a script only to find that your user account doesn’t have the proper rights? You could start up another PowerShell session using the ‘Run as Different User’ option but wouldn’t you rather a PowerShell way? There is. PowerShell offers the PSCredential object type that allows you to store and retrieve credentials. This comes built into the Microsoft.PowerShell.Security module. Running Get-Credential prompts the user for a username and password. To fill the username prompt in simply…

Read More Read More