Archive for the ‘Beginners’ Category


 

Using Prefixes to Prevent Command Name Collision

Monday, February 15th, 2016 by June Blender
In January, I had the honor of presenting to the Mississippi PowerShell User Group (MSPSUG). I've known the organizers, Mike Robbins and Rohn Edwards for years, and truly respect them. The PSUG is online-only, which makes it a challenge for presenters, but they attract a very sophisticated audience, so my talks there are really conversations. This was a perfect venue for my "Avoiding Version Chaos" talk. (More at PowerShell Saturday in Tampa on March 19, 2016.) In one part of the talk, I demonstrated how to use noun prefixes to distinguish among commands with the same names. The demo flopped…   More »

Using Group-Object to Detect Command Name Conflicts

Wednesday, February 10th, 2016 by June Blender
The Group-Object cmdlet, one of the original provider cmdlets, is as old as Windows PowerShell. It was introduced in version 1.0 and hasn't changed at all since then. But, it is one of my favorites. (You can tell when I love a cmdlet by the number of examples. Group-Object has 9!) In fact, when you use it frequently, you begin to see groups as a path to many solutions. Group-Object groups objects by the values of a property that you choose. So, it's a quick way to find the property values that appear in a data set. Which domain controllers are used by users…   More »

PowerShell GUI Apps: Why think in events?

Monday, January 4th, 2016 by June Blender
Always committed to starting the New Year right, I’m heading to Scottsdale, Arizona on Tuesday, January 5 at 5:30 PM to meet with the newly revived Arizona PowerShell User Group. We’ll meet at the Microsoft Store in Scottsdale Fashion Square. (I will not be distracted by the Surface Pro 4 on display. I will not…)   I’ll be there to lead an interactive hands-on lab in which participants build a basic PowerShell GUI application – essentially, a graphic user interface for a PowerShell script. When you press a button, it runs part of the script. When you type text in…   More »

How I learned to love DialogResult

Wednesday, December 23rd, 2015 by June Blender
This post discusses the DialogResult property of buttons, which often confuses beginning PowerShell GUI app designers. When I first started learning how to write PowerShell GUI applications, I thought of the DialogResult property of buttons as the "evil property." What else would I think? If the DialogResult property of a button is set to any value other than None, when you click the button, the GUI app closes immediately after running the commands in my event handler. In this little app, when you click OK, it pipes a Get-Service command to Out-GridView -- um, very briefly. [video width="1280" height="670" mp4="https://www.sapien.com/blog/wp-content/uploads/2015/12/DialogResult.mp4"][/video]…   More »

Where are v3 and v4? PowerShell Versions in PowerShell Studio

Monday, December 21st, 2015 by June Blender
In this post, we explain why PowerShell Studio can run your scripts only the versions of Windows PowerShell that are installed on local and remote computers. If you've recently upgraded to Windows 10 from Windows 7, 8, or 8.1, you'll notice quickly that you now have Windows PowerShell 5.0. Depending on your upgrade path and subsequent updates, you might be running any version of Windows PowerShell greater than or equal to 5.0.10240. Or, you might have installed the shiny new Windows Management Framework 5.0 for Windows 7 SP1, Windows Server 2008 R2, and later versions of Windows client and server. In…   More »

Spotlight on the Label Control

Wednesday, December 16th, 2015 by June Blender
The Spotlight on Controls series describes the controls, that is, the objects in the System.Windows.Forms namespace, so you can use them effectively when building GUI apps in PowerShell Studio and PrimalScript. Each post focuses on one control and lists its most important properties, methods, and events, including the default event that PowerShell Studio adds to your script when you double-click the control. The posts include many examples written in Windows PowerShell, so you can use them right away. Read more: Spotlight on Controls: Common properties and methods This post describes the Label control. Label Control [System.Windows.Forms.Label] Creates a clickable text…   More »

Displaying Help for a Script in an Executable File

Wednesday, December 9th, 2015 by June Blender
This is the third blog in a multi-part series about designing a Windows PowerShell scripts that will be packaged in an executable file. Passing Parameters to a Script in an Executable File explains how to use the special parsing features of PowerShell Studio and PrimalScript to make passing parameters easy for PowerShell users and authors. Parsing Parameters for a Script in an Executable File explains how to parse parameters manually for special uses. Displaying Help for a Script in an Executable File explains how to display help for a script in an executable file. Output from a Script in an…   More »

Parsing Parameters for a Script in an Executable File

Monday, December 7th, 2015 by June Blender
This is the second blog in a multi-part series about designing a Windows PowerShell script that will be packaged in an executable file. Passing Parameters to a Script in an Executable File explains how to use the special parsing features of PowerShell Studio and PrimalScript to make passing parameters easy for PowerShell users and authors. Parsing Parameters for a Script in an Executable File explains how to parse parameters manually for special uses. Displaying Help for a Script in an Executable File explains how to display help for a script in an executable file. Output from a Script in an…   More »

Create a PowerShell GUI App with a Fixed-Size UI

Thursday, December 3rd, 2015 by June Blender
The newest video in our "Check out this feature" series is actually an answer to a great question that was posed to me on Reddit. A PowerShell GUI with a Fixed-Size UI shows you how to use the features of PowerShell Studio to create a PowerShell GUI app that the end-user cannot resize.   A fixed-size UI is much simpler to manage because you don't have to anchor the form controls or worry about them floating around the form when the user resizes the UI.  In this video, I demonstrate 3 different ways to do it. You can also create a…   More »

Rewind: A Built-In Safety Net in PowerShell Studio

Wednesday, November 25th, 2015 by June Blender
We just released the second video in our "Check out this feature" series, a series of short videos that focus on features you might have missed. Our first video, Function Builder in SAPIEN PowerShell Studio, demonstrated our awesome automation for function and parameter syntax. Our second video, Rewind in PowerShell Studio: A built-in safety net for your scripts, describes the Rewind and Create Restore Point features, which help you recover to a previous version of a script -- or any PowerShell Studio file -- even if you've saved, or closed and reopened the file multiple times. And, the video shows…   More »