Using Windows PowerShell as an IT Pro – Part 2
In my last post I introduced Windows PowerShell and talked about a couple of basic concepts. Knowing what cmdlets are available and being able to get some detail on them enables you to figure out how to accomplish some basic commands on your own. There are two cmdlets that help you get these basic pieces of information, Get-Command and Get-Help.The Get-Command cmdlet gets basic information about cmdlets and other elements of Windows PowerShell commands in the session, such as aliases, functions, filters, scripts, and applications.
Get-Command gets its data directly from the code of a cmdlet, function, script, or alias, unlike Get-Help, which gets its information from help topic files.
Without parameters, “Get-Command” gets all of the cmdlets and functions in the current session.
Get-Command

You can the Get-Command cmdlet to retrieve a list of cmdlets or other elements of Windows PowerShell commands in a variety of ways. One method is to get information about all of the cmdlets and functions with the verb “Add”.
Get-Command -Verb Add

Another method is to search for cmdlets that are related to what you want to work with based on the noun in the cmdlet. For example, you can search for all cmdlets related to Services using a wildcard.
Get-Command *-Service

In my next Post we will look at the Get-Help cmdlet.
No comments:
Post a Comment