ridicurious.com
Powershell

Powershell : Command your CMDLET's

A cmdlet is a lightweight command that is used in the Windows PowerShell environment.

SYNTAX :

Verb-Noun -Parameter Value -SwitchParameter

a

PowerShell cmdlets have a Verb-Noun syntax, which can be seen above. The important thing to note is that the noun is always singular even though the cmdlet might return more than one result.

Here, syntax is capitalized for readability, but Windows PowerShell is case-insensitive.

To see a list of legal verbs in PowerShell you can use the Get-Verb cmdlet.

Knowing and understanding legal verbs and keeping in mind the singular noun rule will assist you in guessing cmdlet names.
For example, suppose you want to get a list of services and their status – that’s right, its as easy as

Get-Service

How do you think we would get a list of running processes – Atta Boy! 😀 that’s right

Get-Process

Powershell Cmdlet’s facilitates a platform to work upon multiple technologies. For example, install Active Directory modules in your powerhsell and check users and groups on the fly.

Get-ADUser

Include the exchange module and check mailboxes and other attributes.

Get-Mailbox

ALIASES :

Powershell comes with this cool feature, which will make your life damn easy. Aliases provide you multiple ways to run the same commands.

For example, You want to get list of items present in current directory, you could run the command

Get-ChildItem

Or, you could simply type and run the command gci which is an alias for Get-ChildItem.

Some of the aliases are just like Linux commands like , ls which is again an alias for Get-ChildItem

Happy Learning !

Related posts

Consistent $Profile across All PowerShell Hosts and a Backup on GitHub

Prateek Singh
8 years ago

Powershell : PSDrives

Prateek Singh
9 years ago

Multiline Commenting in PowerShell ISE

Prateek Singh
9 years ago
Exit mobile version