Posts Tagged ‘juneb’


Starting a PowerShell User Group: An interview with Gary Barnes

Monday, August 1st, 2016 by June Blender
Have you ever wondered what it would be like to start a PowerShell user group? I did an interview with Gary Barnes, Software Development Engineer in Test, Portland, Oregon, who just started PDX PowerShell (@PDXPoShPUG), a PowerShell user group for Portland, OR, USA, and its suburbs, including Vancouver, WA. He has lots of great insights. ------------------------------------- User groups are an incredible vehicle for learning, whether you're a beginner who needs mentoring and support, an expert who needs to know about cutting edge techniques, or just a diehard who loves to learn. They provide expertise, knowledge, challenges, and the sense of…   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 »

Using a ModuleSpecification Object

Monday, June 27th, 2016 by June Blender
With the advent of side-by-side module versions in Windows PowerShell 5.0, the lovely, but obscure ModuleSpecification object has become your new best friend. Use it to make sure that the commands and module that you use are the ones that you intend. Using ModuleSpecification Let's start with an example. I want to get the Expand-Archive command in the Microsoft.PowerShell.Archive cmdlet. I can use Get-Command, of course, but when I surround the command name with wildcard characters to make sure it searches, it returns this: PS C:\ > Get-Command *Expand-Archive* CommandType Name Version Source ----------- ---- ------- ------ Function Expand-Archive…   More »

Which PowerShell Versions are Users Running?

Monday, June 20th, 2016 by June Blender
In March 2016, SAPIEN Technologies, Inc. posted a survey asking users and administrators which versions of Windows PowerShell they're running. We got 148 responses by the April 8 when we closed the survey. This blog post reports the findings. While reading them, please keep in mind that this is not a statistically valid survey. We didn't select users or control for anything. Still, I did not expect these results. I might be a bit naïve about enterprise computing, but I'm surprised by the widespread adoption of Windows PowerShell 4.0 and 5.0. My sense is that the community moved much more…   More »

How to Pass Parameters to a Pester Test Script

Friday, June 17th, 2016 by June Blender
Applies to Pester 3.4.0 Like any Windows PowerShell script, a script that contains Pester tests can include parameters. It's easy enough to run the script and pass parameters and values in the usual way. But, when you use Invoke-Pester to run the script, you need to pass the parameters in a hash table. This blog explains how to do it. This post is the third in a series about how to run Pester tests. See also, How to Run Pester Tests and Invoke-Pester: Run Selected Tests. See the posts in this Pester series: How to Run a Pester Test Invoke-Pester:…   More »

Invoke-Pester: Running Selected Tests

Wednesday, June 15th, 2016 by June Blender
Applies to: Pester 3.4.0 In How to Run Pester Tests, I talked about the different places that you can put your Pester days and the different ways to run them, including, but not limited to, the Invoke-Pester function. Today, I'll talk about the parameters of Invoke-Pester function that let you determine which tests run. Next, I'll show you how to pass parameters to a Pester test file. By default, Invoke-Pester runs all *.Tests.ps1 files in the local directory and its subdirectories. That's a useful default, but the parameters of Invoke-Pester let you control the alternatives. See the posts in this…   More »

How to Run a Pester Test

Monday, June 13th, 2016 by June Blender
Applies to: Pester 3.4.0 When you crack open the Pester module, you find the New-Fixture function, which creates a script and test file pair, and the Invoke-Pester function, which runs Pester tests. But New-Fixture is not the only way to create a Pester test and Invoke-Pester is not the only way to run a test. In this blog post, we'll discuss the different ways to run a Pester test, including, but not limited to, the Invoke-Pester function. In the next post, I'll rave about the cool parameters of Invoke-Pester. See the posts in this Pester series: How to Run a…   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 »