NavigationCmdletProvider.MoveItem Method

Definition

Moves the item specified by path to the specified destination.

protected virtual void MoveItem (string path, string destination);
Parameters
path
String

The path to the item to be moved.

destination
String

The path of the destination container.

Remarks

Providers override this method to give the user the ability to move provider objects using the move-item cmdlet.

        Providers that declare <xref href="System.Management.Automation.Provider.ProviderCapabilities"></xref>
        of ExpandWildcards, Filter, Include, or Exclude should ensure that the path and items being moved
        meets those requirements by accessing the appropriate property from the base class.

        By default overrides of this method should not move objects over existing items unless the Force 
        property is set to true. For instance, the FileSystem provider should not move c:\temp\foo.txt over
        c:\bar.txt if c:\bar.txt already exists unless the Force parameter is true.

        If <code data-dev-comment-type="paramref">destination</code> exists and is a container then Force isn't required and <code data-dev-comment-type="paramref">path</code>
        should be moved into the <code data-dev-comment-type="paramref">destination</code> container as a child.

        The default implementation of this method throws an <xref href="System.Management.Automation.PSNotSupportedException"></xref>.