On Friday, February 24, 2017, I posted the following puzzle on Twitter and Facebook (and here!). We provide a Pester test script and a script with detailed help but no code, and you add the code to the script to make the tests pass. Special thanks to Andy Cahn at Chrysalis School in Seattle for […]
Category: Best practices
Enabling deep script block logging
As of the KB3000850 update and PowerShell 5.0, PowerShell has included script block logging so that admins would have more tools for the blue team side of pen testing. If you’re unfamiliar or have never heard of it before, I recommend giving this blog post a read. Not only does the post describe what script […]
Friday Puzzle: Phantom Help
On Friday, December 16, 2016, I posted the following puzzle on Twitter. It shows a function that has no comment-based help or XML help, but when you run Get-Help on the function, Get-Help displays both a description and notes for the function. What is the source of help for this function? I call this unintentional […]
Why Breaking Changes?
In PowerShell Studio 5.3.130, we made some changes to projects that aren’t recognized by previous versions of PowerShell Studio. This blog post describes the changes, explains why we made them, and offers a workaround in case you really need it. Also, note that SAPIEN has properly incremented the Minor property in the PowerShell Studio version […]
Use PSScriptAnalyzer in PowerShell Studio
Applies to: Windows PowerShell 3.0 and later PSScriptAnalyzer 1.1.0 and later PowerShell Studio 5.2.118 and later PowerShell Studio has long supported best practices in Windows PowerShell, including running and debugging without profiles, avoiding cmdlet and parameter aliases (right-click\Expand to cmdlet, Expand all aliases: Ctrl+Shift+A), using consistent formatting to make maintenance and debugging easier, and using […]
Distributing files with your packaged scripts
We get this question every week: Why can I not include my data files, secondary scripts, modules, other executables etc. with the packaged executable and have it unpack them when I run it? If you have been a SAPIEN customer for a few years you may remember that we had this feature in the packager […]
Open a SAPIEN Forum from PowerShell
UPDATE: Added a -Search parameter that searches all SAPIEN forums for the term that you specify and then opens the page with the results. Thanks to Prasoon V. Karunan for the contribution. I love helping people learn Windows PowerShell and SAPIEN products. I answer questions on Facebook, Twitter, Reddit (love the /r/powershell subreddit), Google+, Slack, email, […]
Which versions of PowerShell do you run?
The PowerShell team released Windows PowerShell 5.0 on Windows 10 last year and just re-released Windows Management Framework (WMF) 5.0 for earlier versions of Windows. But, we know from years of experience that many people don’t upgrade their versions quickly. It takes time to get to know and trust a new version. In a large enterprise, it […]
There’s only one right place for curly braces
If you ever want to start an argument with programmers or scripters, mention your preferred code or script formatting habit. A tweet about the PowerShell backtick continuation character or the placement of comment-based help for a function will elicit enough reaction to bring down a small server. But nothing gets people more riled up than […]
Update-Module 5.0 adds, not updates
Applies to: — Windows PowerShell 5.0.10586.63 — PowerShellGet 1.0.0.1 I’m a huge fan of sharing Windows PowerShell modules and making them easy to find (Find-Module), view (Save-Module), and install (Install-Module). So, I truly love the new PowerShellGet module. However, you really need to understand how it works before you use it. Otherwise, you might end up […]