Uncategorized

Uncategorized

Should I Update to PowerShell 7?

After 3 successful release candidates, the PowerShell team has released their first LTS version of PowerShell 7. With this brings many new enhancements that both bring new capabilities as well as further closing the gap between Windows PowerShell and PowerShell Core.

Uncategorized

Project Spotlight – Crypto Trackr

It seems like Crypto is one of the most popular things to talk about these days, so why not leverage Powershell to help keep track of your coins? For this project I used the CoinMarketCap API module and wrapped it with a simple console menu structure that gives you quick access to that data without the fuss of logging into anything.

Uncategorized

How to remotely force kill a Windows session with Powershell

If you work in Ops support you often run into situations where you need to remotely log a user off their machine. Today I’m going to share my general go-to snippet for quickly doing this. To me, quser.exe does everything I need it to and and the logoff command handles the actual logoff once I know the user ID. So instead of reinventing the wheel, we can simply wrap that in a way that flows quickly.

Uncategorized

Built in alternatives to building a custom GUI

I’ve said it once and I’ll say it again, just because you can create a fancy GUI to run your tool doesn’t mean you need to. There are a number of built in alternatives that allow you to accept user input, show command progress, and display results in a way that is fully supported and doesn’t require you spending time building out an entire user interface. Today we’re going to look at 3 commands that you can leverage to achieve this.

Uncategorized

Manipulating Excel with Windows PowerShell

The need to read, modify, or output to an Excel document seems to be something that commonly occurs in the Powershell world. Whether it’s needing to simply append logs or maybe something more complex where there is data on a number of different sheets within a single workbook. Maybe an external client sends you an Excel sheet and you don’t even have Excel installed. Let’s go over 2 potential ways to manipulate Excel data with Windows PowerShell

Uncategorized

What is a dynamic parameter and why should I care?

Today we’re going to take a brief dive into something I think is a really cool and underutilized ability of Powershell and that is leveraging dynamic parameters. A while back when I first got into GUI creation, I was creating individual functions to create various types of form objects. I mean, how else would you do it? Functions for buttons, textboxes, labels, etc. I quickly got sick of this and decided to start digging into a way I could create objects on the fly and still preserve my beloved IntelliSense. This is when I started messing with the ValidateSet parameter.

Uncategorized

Why VS Code is the new editor of choice

Back when I first started dabbling with Powershell in late 2015 I began using the Powershell ISE and used it for quite a while. At the time it did everything I needed it to, I could run console code right by my editor, had nice shortcuts like ctrl + j to bring up the quick template menu, your scripts are tabbed, and finally it had IntelliSense. For everything it did right it had 1 major flaw, it tends to freeze literally at the worst times for no apparent reason. 

Uncategorized

How to build a Powershell GUI – Part 3

So you’ve got your fancy new GUI created, functions and events all ready to go but seem to be having an issue with the GUI going non-responsive any time you try to do anything? If so you’ve come to the right place. Today we’re going to be integrating runspaces into our PS Event Viewer project to keep everything responsive and create a good user experience when using our new utility.