Convert remote time to local time with ArgumentCompleter and ArgumentTransformation attributes

This article was inspired and is based on the concepts developed by Tobias Weltner (I learned a lot PowerShell concepts from Tobias already) in his excellent series of posts on PowerShell attributes. I would like to share a function that I have created to be able to convert a date and time from a remote … Continue reading Convert remote time to local time with ArgumentCompleter and ArgumentTransformation attributes

Cleaning up text copied from eBooks into MS Word

My preference for reading books is ebooks over printed books. One thing I like about eBooks is the ability to copy and paste chunks of text into Word documents, that I use to summarize the books for better retention. Often times the text contains arbitrary spaces inbetween words, hyphenation, and or word wraps after being … Continue reading Cleaning up text copied from eBooks into MS Word

PowerShell Get-Command -Syntax output explained

In this post, I would like to provide a detailed explanation of the Get-Command -Syntax output. While the output is documented (the format used is actually called a syntax diagram) I found parts of it rather confusing. As an example throughout this post, we will use the output of the command: The output looks quite … Continue reading PowerShell Get-Command -Syntax output explained

Find out in which version a PowerShell Cmdlet was introduced

Some days ago Thomas Rayner (whom I admire for his passion and consistency when it comes to sharing his knowledge) posted about the same topic on his blog. He mentioned a method on how to utilize GitHub in order to find out the earliest Version a PowerShell Cmdlet was introduced. When I read the Thomas's … Continue reading Find out in which version a PowerShell Cmdlet was introduced

Get .net Format Strings for given input

Yet again, long time no post! .net Format Strings are very useful when it comes to taking control over the output of your scripts. e.g.: The problem with those Format Strings is, that hardly anyone can remember them. While there they are thoroughly documented and several nice folks have created cheat-sheets (e.g. here), I thought … Continue reading Get .net Format Strings for given input

PowerShell tricks – Convert copied range from excel to an array of PSObjects

In this post, I would like to share a simple function that converts tables copied from Excel to the clipboard into PowerShell objects. While there are several more efficient ways to retrieve data out of Excel files (e.g. COM, EPPlus), I sometimes just want something quick and dirty to get the job at hand done. … Continue reading PowerShell tricks – Convert copied range from excel to an array of PSObjects

Full text search using PowerShell, Everything, and Lucene

Searching for files is something everyone does on a very regular basis. While Windows is consistently changing the way this is done with every new operating system, the built-in functionality is still far from being sufficient. Therefore, I'm always looking for methods on how to improve this (you can also find several blog posts in … Continue reading Full text search using PowerShell, Everything, and Lucene

Get help for Windows built-in command-line tools with PowerShell

One of the reasons I like PowerShell is its built-in help system (here is a nice post in case you don't know how to use PowerShell's built-in help). E.g.: In fact, once you get comfortable using PowerShell help aka Get-Help, you start missing similar built-in documentation for other tools/scripting languages. Wouldn't it be nice if … Continue reading Get help for Windows built-in command-line tools with PowerShell

Reporting against Pester test results

Pester is (for very good reasons) getting more and more popular. If you don't know about Pester I would highly recommend you to start using it. Here are some good resources to learn about the framework: Test-Driven Development with Pester (June Blender) Pester in Action Part 1: Pester Basics PowerShellMagazine articles about Pester In this … Continue reading Reporting against Pester test results

PowerShell tricks – Open a dialog as topmost window

Windows.Forms provides easy access to several built-in dialogs (see MSDN: Dialog-Box Controls and Components). Here is an usage example to show a "FolderBrowse" dialog: While this works as expected, the dialog won't show up as the topmost window. This could lead to situations where users of your script might miss the dialog or simply complain … Continue reading PowerShell tricks – Open a dialog as topmost window