Archive for the ‘Howto’ Category


Enable WMI Explorer Remote Connection Permissions

Wednesday, September 7th, 2016 by Devin Leaman
One of my first tasks, after I was hired at SAPIEN, was to figure out why users couldn’t view WMI classes on remote computers and turn the solution into an easy-to-follow blog post. After completing that, I had to turn it into a script so that it was even easier to set up. Although I managed to complete the script, there was the catch that it worked only on Windows 8. I couldn’t figure out why it wasn’t working on Windows 10. With the help of a couple of SAPIEN MVPs (thanks, Mike and James!), I’m happy to share that…   More »

Setting up PowerShell on your Mac (Update!)

Friday, August 19th, 2016 by Ferdinand Rios
Now that PowerShell is available on the Mac, we thought it would be useful to show how easy it is to setup a Mac terminal session that automatically opens into PowerShell. Figure 1 shows what we mean. [caption id="attachment_12634" align="aligncenter" width="1130"] Figure 1 - PowerShell Terminal Session[/caption] First you need to download the PowerShell macOS package from here (look for the Get PowerShell section in the and install it using the directions found here . Once PowerShell is installed and running on your system, follow the instructions below to set up your PowerShell terminal Here are the steps to follow: Open Terminal on…   More »

Write a Multi-Form PowerShell GUI App

Tuesday, July 26th, 2016 by June Blender
Tested on: PowerShell 2.0+, PowerShell Studio 2016 This step-by-step example shows you how to create a very simple multi-form PowerShell GUI app. The app consists of a parent form that gets data from a child form and displays it. When you finish, you'll know how to use the basic multi-form features of PowerShell Studio. For details about how these features work under the covers, see How Do Multi-Form Projects Work? For this task, we assume that you know how to create a single-form PowerShell GUI app or that you've participated in a Thinking in Events hands-on lab. Otherwise, start with…   More »

Introducing the SAPIEN Information Center

Tuesday, July 12th, 2016 by June Alane Reif
Over the years, the articles in this blog have grown extensively. There's a lot of valuable information in here, but it's become hard to find because it's mixed in with various tour announcements, special offers, conference recaps, and the like. So, we have decided to pull the important articles and place them—along with information relevant to PowerShell and scripting—in a more organized and easily searchable venue. We are proud to introduce the SAPIEN Information Center. The most recent articles are always highlighted in a list on the left side of the window. The SAPIEN Information Center currently has the following…   More »

How Git branches affect files on disk

Wednesday, May 25th, 2016 by June Blender
When I started using Git back in 2012, I wasn't new to source control systems. I used a database-backed source control system back in the 80's and, at Microsoft, I used Visual Source Safe (VSS) and Team Foundation Server (TFS). I was a whiz at checking files in and out, examining and comparing versions, and restoring versions. Still, when I started to use Git for the Azure "help drawer" docs, I was totally unprepared for the effect of changing branches on Git-managed files on disk. Git Checkout -- An Example Here's an example. I'm working in my fork (my online…   More »

Add custom tools to the menu

Monday, May 23rd, 2016 by June Blender
There are so many features in PowerShell Studio and PrimalScript that I think I can't live without, like the Format Script button, file groups, and conditional breakpoints. But, there are few features I'd love to have that aren't there. They're easy enough to add, but they're really personal to me. Fortunately, I can add them myself. What is a custom tool? The Custom Tool feature in PowerShell Studio and PrimalScript lets you define commands in an INF file and add them to a menu. For example, I have huge Scripts library on One Drive where I keep all of my…   More »

Property Pane: Change property values of multiple objects

Friday, May 20th, 2016 by June Blender
Sometimes, I say things so many times that I start to believe them, even when I'm wrong. Here's a correction of one of the details that I've gotten wrong repeatedly. "You can only use the Properties pane on one object at time." -- me Um, no. The Properties pane in PowerShell Studio displays the properties and property values of an object, that is, one of the Windows Forms controls on the Designer pane. By default, it displays the properties of one object at a time. To determine which object the Properties pane displays: In the Designer pane, click the object. -or-…   More »

GitHub: How to update your fork

Monday, May 16th, 2016 by June Blender
Like almost everyone in the DevOps world, I use GitHub, not because I like it, but because everyone uses it. In fact, I dislike it, because it’s confusing by design. Its misleading language excludes users, rather than welcoming them. To use it, you have to forget the actual meaning of words in English, or even their technical meaning, and use them as though they are arbitrary strings. Worst of all, because most people memorize a command sequence without fully understanding how it works, when something goes wrong, it’s almost impossible to troubleshoot. Okay, enough ranting. I just discovered a solution…   More »

How to Write About Help for your Module

Monday, May 2nd, 2016 by June Blender
Since installing PowerShell 5.0, I've been using the PowerShellGet cmdlets to install and examine many of the new modules on PowerShell Gallery. Unfortunately, this is often quite a chore. While many have some help for cmdlets, few have an About topic that tells me how to use the cmdlets together to solve real-world problems. And, in those that do, the About topic feels like the authors wrote whatever popped into their minds at the time. In this post, I'll share my ideas for best practices for writing the primary About_Help topic for your module. Best Practices for a Module About_Help…   More »

Setting Conditional Breakpoints

Wednesday, April 20th, 2016 by June Blender
Applies to PowerShell Studio 2016, PrimalScript 2016, and later. I write lots of scripts — for production, for research, for testing, and for demonstrations. And, inevitably, I hit a bug. I'm actually relieved when I do, because no code is perfect and I'd rather find the bugs before my users do. In fact, I make sure the content in my test database is full of oddities so it's as close to the real world as possible. When you are debugging with a large test sample, like a database or directory, the default line breakpoints are not sufficient. I can hit…   More »