Today I stumbled upon a neat new module by Doug Finke that I can see being useful to add a bit of visual flair to your object data. OutTabulatorView is a brand new module that creates a HTML/CSS/JS based output to easily bring your data to life. Some features I find interesting are: progress charting, star based rating, true/false imaging, and grouping.
Error handling is easily one of the most overlooked things about Powershell in my opinion, it seems like I see a ton of well written scripts with just improper error handling, but why? It's actually not that hard of a concept, until you aren't sure whether or not something produces a terminating error... Unless you know 1 extremely simple tip…
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.
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.
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.
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
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.
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.
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.
The other day we laid out the design for our PS Event Viewer utility, today for part 2 we will be designing and configuring. For this project I decided to leverage PoshGUI, which is great for quickly creating standalone forms. It definitely has it's limitations, for example what if your form grows and shrinks? You would probably want to use a TableLayoutPanel with dock properties set to 'fill' so that you don't have to guess the sizes of the objects as the form grows/shrinks. In this case…
It seems like more and more I am seeing people wanting to implement GUIs into their tools, my hope is that this example can be used as a model for a way to properly create a WinForm GUI for your shiny new utility that you just got done creating.
In this multi-part series I will be going through from start to finish a replacement tool for Windows Event Viewer…
At one point or another you've probably heard of Pester. Pester is great for streamlining unit and acceptance testing and is versatile enough to work with both real and mock data. The problem I've often run into is knowing when (and when not) to leverage Pester to create additional tests. For me, it came down to asking myself 1 thing... Does the underlying technology that your code is built upon constantly change?
If you've ever created a WinForm GUI in Powershell you've probably dealt with not being able to click the X on the Form to close a hung command. Even by running the command separate from the GUI in a job or runspace you still need a way to force close your tool. An easy go-to might be to just kill powershell.exe, but what if you have multiple instances, how you do know which one to kill?