Powershell: You need a Get-MyServer function

As your library of scripts and automation grows, everything you do will start to depend on your common datasets. Datasets like your user information or server details. Just think about how many scripts and tools you already have that either get a list of servers or you provide it a list of servers. It may be time for you to create a common interface to your data.

[Read More]
Tags: PowerShell

Powershell: Windows Defender vs PowerShell Modules, Peasecto.A

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.

[Read More]
Tags: PowerShell

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]
Tags: Review

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.

[Read More]
Tags: PowerShell

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]
Tags: PowerShell

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]
Tags: PSGraph

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: 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.

xkcd.com

Image from xkcd.com, slightly altered

[Read More]