On Preferences and Scopes

Progress in PowerShell: a tale of Verbosity and other preferences with lessons in Scopes and Proxies thrown in It started, as these things often do, with someone complaining. In PowerShell Version 7.2 the output of Invoke-WebRequest -Verbose and Invoke-RestMethod -Verbose look like this: In all the earlier versions they look like the ...

How to Preview PowerShell Scripts In PowerShell

Q: When I use Windows Explorer and select a PowerShell script file - I do not see the script in the preview window. Can I fix that? A: You can make a few simple registry updates and do just what you want! At some time in the deep and distant past, Windows Explorer gained the preview pane feature. The idea is simple: you select a file in ...

How to Use $PSDefaultParameterValues

Q: When I use cmdlets like Receive-Job and Format-Table, how do I change default values of the Keep and Wrap parameters? A: Use the $PSDefaultValues automatic variable. When I first discovered PowerShell's background jobs feature, I would use Receive-Job to view job output - only to discover it's no longer there. And almost too often to ...

How to Use $FormatEnumerationLimit

Q: When I format an object where a property contains more than 4 objects, I never see the extra property values. How can I fix that? A: Use the $FormatEnumerationLimit variable. This query is one I hear in many PowerShell support forums, and I have encountered this issue a lot over the years. What happens is that you issue a command to ...

How to use the Secret modules

Q: I have a bunch of scripts we use in production that make use of Windows credentials. In some cases, these scripts have an actual password in plain text, while others read the password from an XML file. Is there a better way? A: Scripts with high-privilege account passwords in plain text is not a good idea. There are several methods you can...

A closer look at the Crescendo configuration

In my previous post, I looked at the details of a Crescendo output handler from my VssAdmin module. In this post, I explain the details of a cmdlet definition in the Crescendo JSON configuration file. The purpose of the configuration The structure for the interface of a cmdlet is a reasonably predictable thing. The pattern of the ...

A closer look at the parsing code of a Crescendo output handler

In my previous post, I showed you how to parse the output from the netstat command. The output of netstat is not very complex. The goal of the post was to introduce some parsing strategies that you can use to create a full Crescendo module. In this post, I explain the details of a more complex parsing function that I created for my VssAdmin ...

Converting string output to objects

In my previous post, I talked about using Crescendo to create a PowerShell module for the vssadmin.exe command in Windows. As I explained, you have to write Output Handler code that parses the output of the command you are using. But if you never written a parser like this, where do you start? In this post I show you how to parse the output ...

Understanding Get-ACL and AD Drive Output

Understanding Active Directory ACL using PowerShell can be a bit tricky. There are no out-of-the-box cmdlets with ActiveDirectory PowerShell module to help in settings the permission quickly. While there are no cmdlets, you can nevertheless manage AD permissions using the AD PowerShell drive. In this post, I will try to simplify Active ...