Let's start with basic navigation in PowerShell.
Note:
PowerShell is case-insensitive.
Commands (like dir, cd, cls, clear
) are called cmdlet in PowerShell's terms.
To clear the output in the shell, you can use CTRL+L
, cls
, or clear
or Clear-Host
.
cmdlet in PowerShell has a Verb-Noun
structure.
There are many commands that are aliases for a specific command in PowerShell. For Example, dir
is an alias for a cmdlet Get-ChildItem
Similarly, there are other aliases. To find them, type either Get-Alias
or alias
.
You also type gal
for Get-Alias
to find the alias.
As we all know, PowerShell is the latest shell built based on the latest technology, C#
and .Net
in this case. PowerShell's real capability lies in its object. It doesn't only work with the simple text-based input-output streams but objects. Please Note that select
is an alias for Select-Object
.
Passing arguments such as -First #
, -Last #
, -Index #
. Please replace the #
sign with a number. Remember, PowerShell starts counting from 0.
You can keep piping and get a more fine-grained result.
You can drill down and find more and more properties regarding a specific command that may be used in a specific situation.
You can do the same things in a different way (in PowerShell way):
We can get help using Get-Help cmdlet
If you are unsure about the command you're looking for, you can use a wildcard like a star (*). For example. Get-Command *printer*
will give all possible outputs that have the word printer
at either one or both ends.
For more information, please watch this video. John Hammond is awesome!
For more information, please watch this video. John Hammond is awesome!
​
​