Skip to content

Latest commit

 

History

History
345 lines (242 loc) · 13.9 KB

File metadata and controls

345 lines (242 loc) · 13.9 KB
description ms.date ms.topic title
Provider cmdlets
09/12/2016
reference
Provider cmdlets

Provider cmdlets

The cmdlets that the user can run to manage a data store are referred to as provider cmdlets. To support these cmdlets, you need to overwrite some of the methods defined by the base provider classes and interfaces.

Here are the provider cmdlets that can be run by the user:

PSDrive cmdlets

Get-PSDrive

This cmdlet returns the PowerShell drives in the current session. You do not need to overwrite any methods to support this cmdlet.

New-PSDrive

This cmdlet allows the user to create PowerShell drives to access the data store. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.DriveCmdletProvider class:

  • Newdrive
  • NewDriveDynamicParameters

Remove-PSDrive

This cmdlet allows the user to remove PowerShell drives that access the data store. To support this cmdlet, overwrite the System.Management.Automation.Provider.DriveCmdletProvider.Removedrive method.

Item cmdlets

Clear-Item

This cmdlet allows the user to remove the value of an item in the data store. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.ItemCmdletProvider class:

  • Clearitem
  • ClearItemDynamicParameters

Copy-Item

This cmdlet allows the user to copy an item from one location to another. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.ContainerCmdletProvider class:

  • Copyitem
  • CopyItemDynamicParameters

Get-Item

This cmdlet allows the user to retrieve data from the data store. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.ItemCmdletProvider class:

  • Getitem
  • GetItemDynamicParameters

Get-ChildItem

This cmdlet allows the user to retrieve the child items of the parent item. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.ContainerCmdletProvider class:

  • GetChildItems
  • GetChildItemsDynamicParameters
  • GetChildNames
  • GetChildNamesDynamicParameters

Invoke-Item

This cmdlet allows the user to perform the default action specified by the item. To support this cmdlet, overwrite the System.Management.Automation.Provider.ItemCmdletProvider.InvokeDefaultAction method.

Move-Item

This cmdlet allows the user to move an item from one location to another location. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.Navigationcmdletprovider class:

  • MoveItem
  • MoveItemDynamicParameters

New-ItemProperty

This cmdlet allows the user to create a new item in the data store.

Remove-Item

This cmdlet allows the user to remove items from the data store. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.ContainerCmdletProvider class:

  • RemoveItem
  • RemoveItemDynamicParameters

Rename-Item

This cmdlet allows the user to rename items in the data store. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.ContainerCmdletProvider class:

  • RenameItem
  • RenameItemDynamicParameters

Set-Item

This cmdlet allows the user to update the values of items in the data store. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.ItemCmdletProvider class:

  • SetItem
  • SetItemDynamicParameters

Item content cmdlets

Add-Content

This cmdlet allows the user to add content to an item.

Clear-Content

This cmdlet allows the user to delete content from an item without deleting the item. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IContentCmdletProvider interface:

  • ClearContent
  • ClearContentDynamicParameters

Get-Content

This cmdlet allows the user to retrieve the content of an item. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IContentCmdletProvider interface:

  • GetContentReader
  • GetContentReaderDynamicParameters

The GetContentReader method returns an System.Management.Automation.Provider.IContentReader interface that defines the methods used to read the content.

Set-Content

This cmdlet allows the user to update the content of an item. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IContentCmdletProvider interface:

  • GetContentWriter
  • GetContentWriterDynamicParameters

The GetContentWriter method returns an System.Management.Automation.Provider.IContentWriter interface that defines the methods used to write the content.

Item property cmdlets

Clear-ItemProperty

This cmdlet allows the user to delete the value of a property. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IPropertyCmdletProvider interface:

  • ClearProperty
  • ClearPropertyDynamicParameters

Copy-ItemProperty

This cmdlet allows the user to copy a property and its value from one location to another. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IDynamicPropertyCmdletProvider interface:

  • CopyProperty
  • CopyPropertyDynamicParameters

Get-ItemProperty

This cmdlet retrieves the properties of an item. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IPropertyCmdletProvider interface:

  • GetProperty
  • GetPropertyDynamicParameters

Move-ItemProperty

This cmdlet allows the user to move a property and its value from one location to another. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IDynamicPropertyCmdletProvider interface:

  • MoveProperty
  • MovePropertyDynamicParameters

New-ItemProperty

This cmdlet allows the user to create a new property and set its value. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IDynamicPropertyCmdletProvider interface:

  • NewProperty
  • NewPropertyDynamicParameters

Remove-ItemProperty

This cmdlet allows the user to delete a property and its value. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IDynamicPropertyCmdletProvider interface:

  • RemoveProperty
  • RemovePropertyDynamicParameters

Rename-ItemProperty

This cmdlet allows the user to change the name of a property. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IDynamicPropertyCmdletProvider interface:

  • RenameProperty
  • RenamePropertyDynamicParameters

Set-ItemProperty

This cmdlet allows the user to update the properties of an item. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.IPropertyCmdletProvider interface:

  • SetProperty
  • SetPropertyDynamicParameters

Location cmdlets

Get-Location

Retrieves information about the current working location. You do not need to overwrite any methods to support this cmdlet.

Pop-Location

This cmdlet changes the current location to the location most recently pushed onto the stack. You do not need to overwrite any methods to support this cmdlet.

Push-Location

This cmdlet adds the current location to the top of a list of locations (a "stack"). You do not need to overwrite any methods to support this cmdlet.

Set-Location

This cmdlet sets the current working location to a specified location. You do not need to overwrite any methods to support this cmdlet.

Path cmdlets

Join-Path

This cmdlet allows the user to combine a parent and child path segment to create a provider-internal path. To support this cmdlet, overwrite the System.Management.Automation.Provider.NavigationCmdletProvider.MakePath method.

Convert-Path

This cmdlet converts a path from a PowerShell path to a PowerShell provider path.

Split-Path

Returns the specified part of a path.

Resolve-Path

Resolves the wildcard characters in a path, and displays the path contents.

Test-Path

This cmdlet determines whether all elements of a path exist. To support this cmdlet, overwrite the following methods of System.Management.Automation.Provider.ItemCmdletProvider class:

  • ItemExists
  • ItemExistsDynamicParameters

PSProvider cmdlets

Get-PSProvider

This cmdlet returns information about the providers available in the session. You do not need to overwrite any methods to support this cmdlet.