Structure and Naming
Last updated
Last updated
Modules can be used to package and distribute cohesive libraries of functions that perform common tasks. Typically, the names of these functions share one or more nouns that reflect the common task that they are used for. These functions can also be similar to .NET Framework classes in that they can have public and private members. For example, a library can contain a set of functions for file transfers. In this case, the noun reflecting the common task might be “file.”
Modules can be used to customize your environment by adding specific cmdlets, providers, functions, and variables.
A cmdlet is a lightweight command that is used in the Windows PowerShell environment. Cmdlets perform an action and typically return a Microsoft .NET Framework object to the next command in the pipeline.
Cmdlets differ from commands in other command-shell environments in the following ways:
Cmdlets are instances of .NET Framework classes; they are not stand-alone executables.
Cmdlets can be created from as few as a dozen lines of code.
Cmdlets do not generally do their own parsing, error presentation, or output formatting. Parsing, error presentation, and output formatting are handled by the Windows PowerShell runtime.
Cmdlets process input objects from the pipeline rather than from streams of text, and cmdlets typically deliver objects as output to the pipeline.
Cmdlets are record-oriented because they process a single object at a time.
A cmdlet, which is expressed as a verb-noun pair, has a .ps1 extension. Each cmdlet has a that can be accessed by typing Get-Help <cmdlet-Name> -Detailed. The detailed view of the cmdlet help file includes a description of the cmdlet, the command , descriptions of the and an example that demonstrate the use of the cmdlet.
Every command in PowerShell is composed of 2 parts:
Do something-To something
Shows all available verbs
Shows only verbs that starts with s
Some cmdlets have also aliases that are similar to unix-like commands.
You can get a lit of aliases:
You can see a list of all available verbs or with bellow cmdlet: