In this demo, we will see how some PS drive adds custom parameter
based on the type of data that is being accessed in that drive.
We'll then see how some PowerShell module or snap‑in adds an
additional PS drive automatically.
We earlier talked about CodeSigningCert parameter that shows
up only while we are in cert PS drive.
Currently, I'm in C drive, which is a file system drive. I'll now enter
Get‑Item command and switch through available parameters.
As I keep switching, we can see that the CodeSigningCert has still not appeared.
I'll now change the PS drive to cert using Set‑Location command and then enter
cert: PS drive. Now I'll again enter same command,
Get‑Item, and switch through available parameters.
We can now see that the CodeSigningCert parameter is now available.
This is an example of how the set of available parameters
for a command may get changed depending on the drive in
which the command is being executed.
We will now see how an additional Active Directory PS provider gets added when
we install RSAT module for Active Directory. RSAT is the abbreviation of Remote
Server Administration Tools. From the name itself,
you can guess that it's a collection of tools that are used to
administer remote computers. Installing RSAT will install required
snap‑ins and PowerShell modules which are required to manage roles
and features of remote computers.
I'll quickly show you how we can install RSAT tool for Active
Directory on Windows 10. I'll first go to Settings,
click on Apps, go to Optional features,
click on Add feature, and in the search box, I'll type RSAT. This will list
RSAT tool for different server roles. For this demo, we are interested in RSAT
tool for Active Directory. I'll select it and click on Install. The RSAT tool
will install Active Directory PowerShell module which will enable us to connect
to Active Directory PS drive.
Remember that your machine needs to be a member of Active Directory domain to
connect to ADPS drive. So we are back in our demo, and now I have installed
RSAT tool for Active Directory on this system. First, I'll run Get‑PSProvider
command and we can see that the default providers that were available earlier
is displayed on the screen. Since I now have RSAT tool installed, I can
import Active Directory module. Once I do that, I'll again run Get‑PSProvider
command, and now we can see that Active Directory PS provider got added and
its associated AD drive is also listed in drive's column. I'll now enter into
AD drive using Set‑Location command and run Get‑ChildItem command. This will
list AD partitions. I can enter any of this AD partition and get details of
AD objects present in that partition. I'll use Set‑Location command and enter
domain partition.
Once I'm in, I'll run Get‑ChildItem command and the list of immediate OUs present in that domain will get listed.