Вы находитесь на странице: 1из 5

ITEMPROPERTY CMDLETS

Clear-ItemProperty
Copy-ItemProperty
Get-ItemProperty
Move-ItemProperty
New-ItemProperty
Remove-ItemProperty
Rename-ItemProperty
Set-ItemProperty

LOCATION CMDLETS
Get-Location
Pop-Location
Push-Location
Set-Location

PATH CMDLETS
Join-Path
Convert-Path
Split-Path
Resolve-Path
Test-Path

PSDRIVE CMDLETS
Get-PSDrive
New-PSDrive
Remove-PSDrive

PSPROVIDER CMDLETS
Get-PSProvider

VIEWING PROVIDER DATA


The primary benefit of a provider is that it ex
poses its data in a familiar
and consistent way. The model for data presenta
tion is a file system
drive.

To use data that the provider exposes, you view


it, move through it,
and change it as though it were data on a hard
drive. Therefore, the most
important information about a provider is the n
ame of the drive
that it supports.

The drive is listed in the default display of t


he Get-PsProvider cmdlet,
but you can get information about the provider
drive by using the
Get-PsDrive cmdlet. For example, to get all the
properties of the
Function: drive, type:

get-psdrive Function | format-list *

You can view and move through the data in a pro


vider drive just as
you would on a file system drive.

To view the contents of a provider drive, use t


he Get-Item or Get-ChildItem
cmdlets. Type the drive name followed by a colo
n (:). For example, to
view the contents of the Alias: drive, type:

get-item alias:

You can view and manage the data in any drive f


rom another drive by
including the drive name in the path. For examp
le, to view the
HKLM\Software registry key in the HKLM: drive f
rom another drive, type:

get-childitem hklm:\software
To open the drive, use the Set-Location cmdlet.
Remember the colon
when you specify the drive path. For example, t
o change your location
to the root directory of the Cert: drive, type:

set-location cert:

Then, to view the contents of the Cert: drive,


type:

get-childitem

MOVING THROUGH HIERARCHICAL DATA


You can move through a provider drive just as y
ou would a hard disk drive.
If the data is arranged in a hierarchy of items
within items, use a
backslash (\) to indicate a child item. Use the
following format:

drive:\location\child-location\...

For example, to change your location to the HKL


M\Software registry key,
type a Set-Location command, such as:

set-location hklm:\software

You can also use relative references to locatio


ns. A dot (.) represents the
current location. For example, if you are in th
e HKLM:\Software\Microsoft
registry key, and you want to list the registry
subkeys in the
HKLM:\Software\Micrsoft\PowerShell key, type th
e following command:

get-childitem .\powershell

FINDING DYNAMIC PARAMETERS


Dynamic parameters are cmdlet parameters that a
re added to a cmdlet
by a provider. These parameters are available o
nly when the cmdlet is
used with the provider that added them.

For example, the Cert: drive adds the CodeSigni


ngCert parameter
to the Get-Item and Get-ChildItem cmdlets. You
can use this parameter
only when you use Get-Item or Get-ChildItem in
the Cert: drive.

For a list of the dynamic parameters that a pro


vider supports, see the
Help file for the provider. Type:

get-help <provider-name>

For example:

get-help certificate

LEARNING ABOUT PROVIDERS


Although all provider data appears in drives, a
nd you use the same methods
to move through them, the similarity stops ther
e. The data stores that
the provider exposes can be as varied as Active
Directory locations and
Microsoft Exchange Server mailboxes.
For information about individual Windows PowerS
hell providers, type:

get-help <ProviderName>

For example:

get-help registry

For a list of Help topics about the providers,


type:

get-help * -category provider

SEE ALSO
about_Locations
about_Path_Syntax

Вам также может понравиться