PowerShell PowerUser Tips: The Hash TabExpansion

One of my favorite features in the built-in TabExpansion in PowerShell is one that many (if not most) users are unaware of: the “#” hash mark. In order to test this tip, you’re going to need a command console that you’ve used and typed several commands into, so that Get-History will return more than a ...

PowerBoots: The tutorial walkthrough

Updated to PowerBoots 0.1 An introduction to PowerBoots Please excuse me if I start by just copying the basic ideas of the Shoes Tutorial, but I figured that since PowerBoots is inspired by Shoes, that was as good a place as any to start. PowerBoots (or just “Boots”) is a PowerShell 2.0 module with functions ...

PowerShell PowerUser Tips: List the Cmdlets in an Assembly

Tiny script… let me know if you know a better way. function Get-Cmdlets { param([System.Reflection.Assembly]$assembly) $assembly.GetTypes() | Where-Object {      $_.GetCustomAttributes([System.Management.Automation.CmdletAttribute],$false) } | ForEach-Object {      $type = $_      $_.GetCustomAttributes([System.Management.Automation.CmdletAttribute],$false)   } | Select VerbName, NounName, @{n="Type";e={$type}} | } ## Example usage. ## You can use the [System.Reflection.Assembly]::Load... methods to get ...

PowerShell Power User Tips: A Better Prompt

For this edition of my Power User tips for PowerShell, I’m going to share my (heavily annotated) prompt function. Feel free to to copy useful pieces or just place the whole thing in your profile script I’m not going to say anything more, I’ll let the comments speak for themselves. Edit: Someone just pointed out ...

Ideas for Writing Composable PowerShell scripts

I was just having some fun with some recent blog posts… WPF & PowerShell – Part 5 has a script for “Get-Listbox” and for “Show-Control” and Halr9000 wrote a script he called Get-PSBlogroll I had modified the example from the WPF post to create a listbox which will “start” whatever you double click … Get-Listbox ...

PowerShell Power User Tips: Bash-style “alias” command.

I keep hearing from new users who are used to bash-style aliases, how frustrating it is not to be able to create aliases with parameters, the way you can in bash … I’m going to show you how to make the “alias” command work roughly the way it does in bash, but first, let me ...

PowerShell Power User Tips: Current Directory

This is the second in an occasional series of tips for PowerShell users: short posts which don’t intend to give guidance, but merely a tip on a feature you may not be aware of, or maybe even answers to some of the recurring questions that come up in #PowerShell. Fixing the “Current Directory” problem The ...