PowerShell Community

A place for the community to learn PowerShell and share insights

How to Use $PSDefaultParameterValues
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
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
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
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 ...
Converting string output to objects
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 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 ...
My Crescendo journey
My Crescendo journey
In a recent PowerShell Users Group meeting I was thinking that it might be good to talk about the new Crescendo module and how to use it. I was going to ask Jason Helmick if he would do a presentation for us. Then, in an unrelated conversation, someone mentioned using vssadmin.exe for some project. This got me thinking: vssadmin is a perfect ...
How to Make Use Of PowerShell Profile Files
How to Make Use Of PowerShell Profile Files
Q: I would like to personalize the way that PowerShell works. I have heard that I can use a thing called a profile to do this, but when I try to find information about profiles, I come up blank. There is no New-Profile cmdlet, so I do not see how to create such a thing. Can you help me, please? A: Profiles are a powerful part of PowerShell ...
How can I be notified any time a service goes down?
How can I be notified any time a service goes down?
Q: How can I be notified any time a service goes down? A: The short quick answer to utilizing WMI and PowerShell 7. You use PowerShell to create temporary event monitoring using WMI. Then WMI monitors any service changes and generates an alert once it detects a change. Basic Requirement To achieve this, you need Windows ...