December 29th, 2012

PowerTip: Find Which PowerShell Cmdlets Have Most Aliases

Doctor Scripto
Scripter

Summary: Find out which Windows PowerShell cmdlets have the most defined aliases.

Hey, Scripting Guy! Question How can I determine which Windows PowerShell cmdlets have the most aliases?

Hey, Scripting Guy! Answer Use the Get-Alias cmdlet and group by the definition. Sort the count in a descending manner, and select the top 10 items. The following command accomplishes this task where gal is an alias for Get-Aliasgroup is an alias for Group-Objectsort is an alias for Sort-Object, and select is an alias for Select-Object.

gal | group definition | sort count -Descending | select -First 10

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

    '; block.insertAdjacentElement('beforebegin', codeheader); let button = codeheader.querySelector('.copy-button'); button.addEventListener("click", async () => { let blockToCopy = block; await copyCode(blockToCopy, button); }); } }); async function copyCode(blockToCopy, button) { let code = blockToCopy.querySelector("code"); let text = ''; if (code) { text = code.innerText; } else { text = blockToCopy.innerText; } try { await navigator.clipboard.writeText(text); } catch (err) { console.error('Failed to copy:', err); } button.innerText = "Copied"; setTimeout(() => { button.innerHTML = '' + svgCodeIcon + ' Copy'; }, 1400); }

    Feedback