Commands and parameters

First of all, we need to clarify about the different naming conventions around commands. You have probably heard of Cmdlets, which technically refer to the compiled commands written in C#. In addition, there exist functions which are script-based commands and commands as  the regular commands used in PowerShell. A best practice is to use a combination of a verb, which describes an action, and a noun, describing an object or type. As an introduction, you should try to use the following cmdlets in VSCode. These cmdlets are the most basic ones, and you will probably use them daily:

#Example of a cmdlet
# Do-Something
# Verb-Noun

#Retrieving Help and examples
Get-Help

#Retrieves all commands
Get-Command

#Shows full help about the cmdlet Get-Command
Get-Help Get-Command -Detailed

#Downloads and updates the help on this computer - needs Admin rights
Update-Help

#Shows typical example for the cmdlet Get-Command
Get-Help Get-Service -Examples

#All command containing 'service'
Get-Command *service*

#Retrieves all cmdlets from the module Microsoft.PowerShell.Utility
Get-Command -Module Microsoft.PowerShell.Utility

#Shows all modules
Get-Module

#Retrieves member and typ of the object
Get-Member -InputObject 'string'

#Can also be piped to
'string' | Get-Member

#Approved verbs
Get-Verb
Take a look at the following URL for further information: https://msdn.microsoft.com/en-us/library/ms714395(v=vs.85).aspx. It is recommended that you use approved verbs in the cmdlets. You can retrieve them with Get-Verb. Further information can be found at: https://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).aspx

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset