Provider cmdlet parameters

Provider cmdlets come with a set of static parameters that are available to all providers that support the cmdlet, as well as dynamic parameters that are added when the user specifies a certain value for certain static parameters of the provider cmdlet.

Provider Cmdlet Static Parameters

Static parameters are defined by Windows PowerShell. A large set of these parameters is implemented by Windows PowerShell to provide consistency across all the providers and to provide a simpler development experience. Examples of these parameters include the literalPath, exclude, and include parameters of the Get-Item cmdlet. A smaller set of these parameters can be overwritten to provide actions that are specific to your provider. Examples of these parameters include the Path and Value parameter of the Set-Item cmdlet. Here is a list of the parameters that can be overwritten for the provider cmdlets.

Clear-Content cmdlet
You can define how your provider will use the values passed to the Path parameter of the Clear-Content cmdlet by implementing the ClearContent method.

Clear-Item cmdlet
You can define how your provider will use the values passed to the Path parameter of the Clear-Item cmdlet by implementing the ClearItem method.

Clear-ItemProperty cmdlet
You can define how your provider will use the values passed to the Path and Name parameters of the Clear-ItemProperty cmdlet by implementing the ClearProperty method.

Copy-Item cmdlet
You can define how your provider will use the values passed to the Path, Destination, and Recurse parameters of the Copy-Item cmdlet by implementing the CopyItem method.

Get-ChildItems cmdlet
You can define how your provider will use the values passed to the Path and Recures parameters of the Get-ChildItem cmdlet by implementing the GetChildItems and GetChildNames methods.

Get-Content cmdlet
You can define how your provider will use the values passed to the Path parameter of the Get-Content cmdlet by implementing the GetContentReader method.

Get-Item cmdlet
You can define how your provider will use the values passed to the Path parameter of the Get-Item cmdlet by implementing the GetItem method.

Get-ItemProperty cmdlet
You can define how your provider will use the values passed to the Path and Name parameters of the Get-ItemProperty cmdlet by implementing the GetProperty method.

Invoke-Item cmdlet
You can define how your provider will use the values passed to the Path parameter of the Invoke-Item cmdlet by implementing the InvokeDefaultAction method.

Move-Item cmdlet
You can define how your provider will use the values passed to the Path and Destination parameters of the Move-Item cmdlet by implementing the MoveItem method.

New-Item cmdlet
You can define how your provider will use the values passed to the Path, ItemType, and Value parameters of the New-Item cmdlet by implementing the NewItem method.

New-ItemProperty cmdlet
You can define how your provider will use the values passed to the Path, Name, PropertyType, and Value parameters of the New-ItemProperty cmdlet by implementing the NewProperty method.

Remove-Item
You can define how your provider will use the values passed to the Path and Recurse parameters of the Remove-Item cmdlet by implementing the RemoveItem method.

Remove-ItemProperty
You can define how your provider will use the values passed to the Path and Name parameters of the Remove-ItemProperty cmdlet by implementing the RemoveProperty method.

Rename-Item cmdlet
You can define how your provider will use the values passed to the Path and NewName parameters of the Rename-Item cmdlet by implementing the RenameItem method.

Rename-ItemProperty
You can define how your provider will use the values passed to the Path, NewName, and Name parameters of the Rename-ItemProperty cmdlet by implementing the RenameProperty method.

Set-Content cmdlet
You can define how your provider will use the values passed to the Path parameter of the Set-Content cmdlet by implementing the GetContentWriter method.

Set-Item cmdlet
You can define how your provider will use the values passed to the Path and Value parameters of the Set-Item cmdlet by implementing the SetItem method.

Set-ItemProperty cmdlet
You can define how your provider will use the values passed to the Path and Value parameters of the Set-Item cmdlet by implementing the SetProperty method.

Test-Path cmdlet
You can define how your provider will use the values passed to the Path parameter of the Test-Path cmdlet by implementing the InvokeDefaultAction method.

In addition, you cannot specify the characteristics of these parameters, such as whether they are optional or required, nor can you give these parameters an alias or specify any of the validation attributes. In contrast, you can specify parameter characteristics in stand-alone cmdlets by using attributes such as the Parameters attribute.

Provider Cmdlet Dynamic Parameters

Dynamic parameters for cmdlet providers are similar to dynamic providers for stand-alone cmdlets. In both cases, the parameters are added to the cmdlet when the user specifies a certain value for one of the default parameters, such as the path parameter. However, not all of the static parameters can be used to trigger the addition of dynamic parameters. For more information about dynamic parameters, see Provider cmdlet dynamic parameters.

See Also



Show:
© 2015 Microsoft