Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Find single-name PowerShell functions

$
0
0

Summary: Learn how to find Windows PowerShell functions that do not have a hyphen in the name.

Hey, Scripting Guy! Question How can I easily find Windows PowerShell functions that do not have a hyphen in the name, but instead are single words, such as the Prompt function?

Hey, Scripting Guy! Answer Use the Get-Command cmdlet and return only functions. Filter out function names that do not contain a hyphen, for example:

gcm -CommandType function | where name -notmatch '-'

Note gcm is an alias for the Get-Command cmdlet.


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>