- <#
- .SYNOPSIS
- This script creates a function to set aliases for all Cmdlets which omit the '-'
- .DESCRIPTION
- This script defines a function which uses Get-Command to find all
- cmdlets. For each of them, it then creates an alias which omits
- the "-". This function was oritinally written by Jeffrey Snover for
- Monad back in the day, but I updated it slightly for PowerShell V2.
- Updated after a comment to be a tad shorter.
- .NOTES
- File Name : Set-ProgrammerAlias.ps1
- Author : Jeffrey Snover - jsnover@microsoft.com
- Updated by : Thomas Lee - tfl@psp.co.uk
- Requires : PowerShell Version 2.0
- .LINK
- This script posted to:
- http://www.pshscripts.blogspot.com
- #>
- ##
- # Start of Script
- function Set-ProgrammerAlias {
- get-command -Com Cmdlet | % {set-alias $($_.Verb + $_.Noun) $_.Name}
- }
This blog contains PowerShell scripts, more PowerShell scripts and still more PowerShell scripts. Occasionally you may see some organisational posts.
Tuesday, 16 March 2010
Set-ProgrammerAlias.ps1
Subscribe to:
Post Comments (Atom)
1 comment:
Why don't you use
get-command -CommandType cmdlet
for listing cmdlets only?
Post a Comment