Introduction to PowerShell Cmdlets
Table of Contents
I. Introduction
When we use PowerShell, we call up commands corresponding to PowerShell cmdlets, DOS commands, scripts and functions. Each command allows us toexecute one or more actions on the machine, depending on its parameters and purpose.
Commands specific to PowerShell, such as Get-Help, Get-Service, Restart-Computer, etc., have a specific name: cmdlet. command-let "(or "commandlet" if you prefer). This is what we'll be looking at in more detail in this chapter.
II. The PowerShell cmdlet concept
First of all, each PowerShell cmdlet has a specific function : create a file, restart the computer, retrieve the process list, create a user, rename a folder, etc... Depending on what it was originally designed to do. cmdlets also have parameters, but we'll deal with that in the next chapter.
It's important to understand that each PowerShell cmdlet refers to a PowerShell module, and that each PowerShell module is associated with a DLL library present on the machine. When a PowerShell console is launched, Windows loads the elements into memory to make them available to the running PowerShell console.
A. The cmdlet noun: verb + noun
Microsoft has had the excellent idea of standardizing the names of PowerShell cmdlets. As a result, each PowerShell cmdlet is made up as follows: a verb + a noun. It's important to remember that the verb and the noun are always separated by a hyphen "-".
Thanks to this logic, and provided you're at least a little at ease with English (yes, all cmdlet names are in English), we can almost translate the name of a cmdlet to understand what it's for.
For example, the "Get-Service" cmdlet is used to obtain a list of all services present on a Windows machine. We might have guessed: Get-Service = Obtenir les services, if we translate literally. From a PowerShell point of view, we get a list of objects corresponding to Windows services. Although it's not always this simple, the mechanics are interesting.
Still not convinced? Here's another example: the "New-Item" cmdlet, where the item can be a file, a folder or even a registry key.

B. Approved verbs
When developers create new PowerShell cmdlets, be aware that the choice of verb is not made randomly. In fact, when choosing a verb, not everything is allowed, even if there is no technical limit.
The following PowerShell cmdlet provides a list of all approved verbs:
Get-Verb
In addition, on the Microsoft site, we can obtain a list of all the approved verbs with their meanings.
Here is an extract from the list of approved verbs:

If we take the example of the verb"Get", Microsoft gives the following description:"Specifies an action that retrieves a resource". This means you'll never have a PowerShell cmdlet that lets you create, delete or modify an element or resource! All "Get-<name>" cmdlets are used to obtain information.
Here are just a few examples:
- Get-Service: obtain the list of services present on the machine
- Get-Process : obtain a list of processes running on the machine
- Get-LocalUser: obtain a list of local user accounts
- Get-Tpm: obtain information on the TPM chip present in the machine
- Get-PSDrive: obtain a list of all drives mounted on the machine
Remember that the verb is used to describe the action initiated by the PowerShell cmdlet, while the noun provides details on the targeted resource typology.
III. Browse the list of PowerShell cmdlets
To explore the list of PowerShell cmdlets available on a machine, use the following cmdlet:
Get-Command
When executed, it returns all the cmdlets available on the local machine. This list may vary from one machine to another, depending on the version of PowerShell used, and also on the PowerShell modules installed by the user. In fact, you can play around with the command below to obtain the total number of cmdlets available on your machine:
(Get-Command).Count
To browse the list of cmdlets more efficiently, we can apply filters using parameters.
Here are a few examples...
- Get a list of all orders with the "Get" verb
Get-Command -Verb Get
- Get a list of all orders with the name "Service".
Get-Command -Noun Service
This is useful for finding the name of a service management cmdlet. The disadvantage is that the name used in the cmdlet must correspond exactly to the one retrieved via Get-Command.

- Get a list of orders based on a keyword, e.g. "service".
Get-Command *service*
Specifying an asterisk before and after the keyword will allow X characters before and Y characters after the keyword "service". In this way, the search is less strict, and compared with the previous example, this command will return additional results. For example, the "New-WebServiceProxy" cmdlet will be returned, as it does contain the term "Service".
IV. Conclusion
Once you've read this chapter, you'll know more about PowerShell cmdlets, although we'll need to go into more detail on the subject of parameters in the next chapter.