March 8th, 2007

Detecting Conflicts between Aliases, Functions, and Cmdlets

PowerShell Team
PowerShell Team

Version 1.1 of the PowerShell Community Extensions has just been release so I decided to kick the tires. After I installed it, I noticed that some conflicts and then realized that there might be conflicts between my customizations and the Aliases, Functions and Cmdlets that they delivered. Here is how I detected what needed to be resolved:

PS> gcm -type cmdlet,function,alias |group name |where {$_.count -gt 1}

Count Name Group
—– —- —–
2 Get-FileVersionInfo {Get-FileVersionInfo, Get-FileVersionInfo}
2 help {help, help}
2 man {man, man}
2 mkdir {mkdir, mkdir}
2 ql {ql, ql}
2 qs {qs, qs}
PS> gcm qs

CommandType Name Definition
———– —- ———-
Function qs “$args”
Alias qs Quote-String


Is that cool or what? Man I love PowerShell!

Enjoy.

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Category
PowerShell

Author

PowerShell Team
PowerShell Team

PowerShell is a task-based command-line shell and scripting language built on .NET. PowerShell helps system administrators and power-users rapidly automate tasks that manage operating systems (Linux, macOS, and Windows) and processes.

0 comments

Discussion are closed.

Feedback