Extending PowerShell DateTime Objects

I’ve been experimenting more with my PSTypeExtensionTools module, finding more objects to enhance.  You can check out the project on Github and install the module from the PowerShell Gallery. My current fun has been with the DateTime object – specifically converting a value into another culture.  Apparently those of us in North America don’t know how to format a date properly. But now with a few script methods added to the DateTime type, I can correct that oversight.

Continue reading

New PowerShell Projects Published

Last week I published a few of the recent PowerShell modules I’ve been working on to the PowerShell Gallery. These projects had been in a beta phase while I worked out some last minute features. I was also waiting to see if there were any issues reported by you that I might need to address. Nothing came up so I think we’re good to go. Here’s the new projects you can install from the PowerShell Gallery.

Continue reading

A PowerShell Input Tool

In PowerShell, the primary means to get interactive input from a user is with the Read-Host cmdlet. There’s nothing wrong with it but sometimes if you are using it in a graphical tool like the PowerShell ISE or VS Code you may not realize you are being prompted. Or perhaps you are building some other type of PowerShell-based tool where you would like something other than a console-based prompt. I thought I’d give a sneak peak at a function I will be adding to my PSScriptTools module that creates a graphical inputbox using WPF.

Continue reading

Who is Running Your PowerShell Script?

I’ve often talked about the benefit of including Verbose output in your PowerShell scripts and functions from the very beginning. This is especially helpful when someone else is running your command but encounters a problem. You can have them start a transcript, run your command with –Verbose, close the transcript and send it to you. if you’ve written informative Verbose messaging you should be able to figure out the problem. Part of the information might include metadata about the person running the command and their environment. To simply things, I’ve created an easy to use function called Get-PSWho.

Continue reading

A PowerShell Module for your Type Extensions

If you’ve been following this blog recently, you’ve read about my fun with PowerShell type extensions. This technique lets you make PowerShell give you the information you want without a lot of work on your part. Well, there is some work but you only have to do it once. To make it even easier, I have been working on a module to simplify this even further. The module is still in beta so I’m hoping some of you will kick it around before I publish it to the PowerShell Gallery.

Continue reading