For a period of time, Windows Defender was flagging several important PowerShell modules as infected with Peasecto.A. This would prevent users from running or installing those modules. Some of the impacted modules included PackageManagement
, MSOnline
, PSScriptAnalyzer
, and VMware.PowerCLI
. Even VSCode was feeling the pain. The good news is that the issue is resolved for some modules now.
Powershell: My thoughts on the future of DSC
I just saw the PowerShell team post an update on the future of Desired State Configuration (DSC). This is the first real update after the release of PowerShell Core 6.0. Without DSC support in PowerShell Core, there have been a lot of questions in the community. I want to take a moment to share my thoughts on what the PowerShell Team had to say.
[Read More]Powershell: Everything you ever wanted to know about the switch statement
Like many other languages, PowerShell has commands for controlling the flow of execution within your scripts. One of those statement is the switch statement and in PowerShell, it offers features that are not found in other languages. Today we will take a deep dive into working with the PowerShell switch
.
What have you done with PowerShell this year?
Over on /r/PowerShell, we share with each other things that we have done with PowerShell every month and reflect on that at the end of the year. As I look back on my year in PowerShell, I see that I have accomplished quite a bit. Not only have I done great work in a professional setting but I have also done a lot for the PowerShell community this year.
[Read More]Powershell: What is pwsh.exe
The pwsh.exe
process is the new name for PowerShell Core starting with version 6.0. The executable changed names from powershell.exe
to pwsh.exe
. Let’s take a look at this executable.
Powershell: Introducing PSGraphPlus with Show-GitGraph
I have been presenting my PSGraph module to a few Powershell user groups. One thing I do in my demos is use local system information to generate graphs. Things like network connections and process relationships. Some of them have turned out to be quite useful. So I have started compiling them into a new module called PSGraphPlus.
One of the commands that I find myself running all the time from this module is Show-GitGraph
. I spent today working on it and I would like to share my progress.
Powershell: Concatenate strings using StringBuilder
Have you ever noticed that some people use StringBuilder in their PowerShell scripts and wondered why? The whole point of using StringBuilder
is to concatenate or build large strings. There are ways to do this in PowerShell already, so why would someone turn to this DotNet object?
Powershell: Tracking changes
Every once in a while, I see someone ask for a way to track changes to something. It reminds me of a script I wrote once to track changes made in Active Directory. Twice a day, my team was emailed with a report showing all the user account, group membership, and group policies that were changed. It turned out to be a valuable tool in giving everyone visibility to the changes that were recently made.
I’m reminded of that script because I handled that scenario in a very generic way that could be applied to many other things that you would want to monitor.
[Read More]Powershell: PSGraph 1.2, The SubGraph Release
When I set out to write PSGraph, it started as a way to just write GraphViz instructions in PowerShell. The structure and syntax of GraphViz heavily influenced how I build the commands in PSGraph. This release polishes some of those commands and starts to work on doing more than just translating command. My focus of 1.2 was to make subgraphs easier to work with.
[Read More]PowerShell: Automatic Module Semantic Versioning
I am just getting started on a new module PSGraphPlus and if you know me, this is when I take a look at how I build modules. I fleshed out a lot of little bugs with my Full Module Plaster Template and I spent a little time working on my module build script. I may talk about that build process in another post but for the sake of this conversation, it is just a script that I run that performs several actions on my module. It runs tests, bumps the version and publishes to the PSGallery.
Today, I am going to walk you through how I bump that version based on changes in my module.
[Read More]Powershell: Top 50 PowerShell Blogs
I just wanted to do a quick shout-out to FeedSpot for including in in their list of Top 50 PowerShell blogs. Thank you for listing my blog along side all those other great blogs.
[Read More]Powershell: The many ways to use regex
Regular expressions (regex) match and parse text. The regex language is a powerful shorthand for describing patterns. Powershell makes use of regular expressions in several ways. Sometimes it is easy to forget that these commands are using regex becuase it is so tightly integrated. You may already be using some of these commands and not even realize it.
[Read More]Image from xkcd.com, slightly altered
Powershell: What have you done this month? May 2017
This is a breakdown of all the posts and other PowerShell projects that I worked on this month.
[Read More]Powershell: Your first internal PSScript repository
Setting up a basic internal repository for scripts and modules is surprisingly simple. I had no idea how easy this was for the longest time. If you are looking for ways to distribute your modules to others in your team, then you should consider this approach.
[Read More]Powershell: Building a Module, one microstep at a time
I am really quick to build a module out of my scripts and functions. I like how it allows me to organize my functions and use them in other scripts. I also see that many PowerShell scripters are slow to take that step of building a module. We often learn how to build a module without really understanding why they are built that way.
In this post, we will turn a common script scenario into a full module one step at a time. We will take several microsteps to show all the subtle details of why common modules are built the way they are. Lets take the mystery out of building a module to see how simple they can be.
[Read More]