Writing Interactive Scripts with PowerShell

If you’re authoring PowerShell scripts that are intended to be interactive, there are a couple of very easy ways to ask your users for input. Typically, user input falls into a couple categories: free-form text input, or a list of pre-defined values. We also might need to prompt the user …

Continue reading

Working with CSV Files in PowerShell

If you’re working with data from PowerShell, you have most likely come across the CSV (Comma Separate Values) format. These files are very easy to work with in PowerShell, thanks to the CSV cmdlets. If this is your first time working with CSV files, it’s easy to discover the CSV-related …

Continue reading

Still using PowerGUI? Get on the Visual Studio train!

Are you still using the old Quest / Dell PowerGUI tool to author your PowerShell scripts and modules? If so, you may want to consider getting off the PowerGUI train, and hopping onto the Visual Studio 2015 or PowerShell Integrated Scripting Editor (ISE) train! By doing so, you will improve …

Continue reading

PowerShell ISE: Jump to Column Feature

If you’re a developer, or even just a frequent user of a text editor, you’re probably familiar with the “Jump to Line” feature of most text editing software. The Microsoft Windows PowerShell Integrated Scripting Editor (ISE) offers such a feature, which is commonly mapped to the CTRL + G keyboard …

Continue reading

Import-DscResource Warning Message in WMF 5.0 April 2015 Preview

The latest version of the Microsoft Windows Management Framework (WMF) Core 5.0 package has some improvements to the PowerShell and Desired State Configuration (DSC) experience. One of those improvements is a warning message that will appear, if you do not use the Import-DscResource dynamic keyword to import the PSDesiredStateConfiguration module. …

Continue reading

PowerShell: Resizing Azure Virtual Machines

Background Did you know that you can scale virtual machines in Microsoft Azure? If you’ve been working with the cloud, you’ve most likely heard about that capability before, but did you know that you can automate this function using PowerShell? It’s true! You can streamline many different operations in Microsoft …

Continue reading

Clean up unused Azure VHD Disks

Introduction The Microsoft Azure platform maintains a list of VHD blobs that have been registered as “disks” in your Azure subscription. You can view a list of registered “disks” by opening the Azure Portal, going to the Virtual Machines node, and selecting the Disks link. Each Azure disk has a …

Continue reading

Implementing a .NET Class in PowerShell v5

Introduction You might have heard that PowerShell version 5.0 has introduced support for building .NET classes. Indeed, this is a powerful, new capability that has not previously existed in native PowerShell syntax. Before the new class-building syntax existed, if you wanted to build custom objects in PowerShell, you generally would …

Continue reading

PowerShell: Build Windows 10 Server Technical Preview VM in Azure

You’ve probably heard about Windows 10 and the Windows Server Technical Preview, right? You can download the Windows 10 Client operating system from https://insider.windows.com, and you can download the Windows Server Technical Preview from your MSDN account, if you have one. A lot of people have stated that the download …

Continue reading

Fix for Service Unavailable in PowerShell DSC Pull Server

Introduction I recently tried to setup a Microsoft Windows PowerShell Desired State Configuration (DSC) Pull Server, and was receiving an error from IIS. I used the xDscWebService DSC Resource, from the xPSDesiredStateConfiguration PowerShell module, to configure the DSC Pull Server. When I tried to browse to the IIS Web Service …

Continue reading