Using a ModuleSpecification Object

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 1.0.0.0…   More »

Testing Pester Code Coverage

June 24th, 2016 by June Blender
Applies to: PowerShell 5.0.10586.122, 5.1.14367, Pester 3.4.0 I'm one of those people who thinks a score of 99% is failing, so I love to see those 100% scores when I use the CodeCoverage parameter of Invoke-Pester. But, while assembling my Pester presentations for DevOps Global Summit 2016 and PowerShell Conference Europe 2016, I realized the 100% code coverage score means that 100% of my code (every line) ran during the test. It doesn't mean that 100% of my code is tested. Code coverage reports are really valuable, but you need to understand what they test and how to use them.…   More »

Job Opening: C# Developer at SAPIEN

June 22nd, 2016 by June Blender
Read our job posting: C# Developer One of the best things you can do for your career is to keep it continually challenging. Never be the smartest person at work. Never be the most experienced. Never watch the industry progress while leaving you behind. Never continue doing it the way you’ve always done it. If you’re looking for something new and challenging, consider joining SAPIEN Technologies, Inc., a small, agile software company that is continually improving to stay at the edge of the technology curve. SAPIEN Technologies, Inc. currently has a job opening for a Windows software developer in our…   More »

Which PowerShell Versions are Users Running?

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

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

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

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 »

Memorial Day Weekend Sale Starts Now!

May 27th, 2016 by Lanae Dale
This weekend we reflect and we remember, those who have paid the ultimate price to protect our freedom.  Please don't forget to take a moment to honor those past and present, who have served our country and put their lives on the line. We appreciate you all, and our thoughts go out to the family and friends of our fallen heroes.     For four days, we are extending our Veteran and Active Military discount to everyone.  Starting now, and going all the way through Monday May 30th at 11:59PM, save big with 30% off of your total software purchase using the discount code…   More »

Using Bash with PrimalScript 2016

May 26th, 2016 by Alex Riedel
I have been asked a few times now to use Bash with PrimalScript. It doesn’t have all the setup for it out of the box because there are a few different implementations of Bash available for Windows. If you followed the latest news, Microsoft has announced at the BUILD 2016 keynote that Bash will become an integral part of Windows. (https://www.youtube.com/watch?v=kJGqZHQzNRo) Since we do not have the bits from Microsoft yet, I used the Cygwin Bash shell to demonstrate the necessary steps for PrimalScript 2016. You can download and install this version from here: https://cygwin.com/install.html There are a few quirks…   More »

How Git branches affect files on disk

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 »