Partager via


NavigationCmdletProvider.MoveItem(String, String) Method

Definition

Moves the item specified by path to the specified destination.

protected:
 virtual void MoveItem(System::String ^ path, System::String ^ destination);
protected:
 virtual void MoveItem(Platform::String ^ path, Platform::String ^ destination);
 virtual void MoveItem(std::wstring const & path, std::wstring const & destination);
protected virtual void MoveItem (string path, string destination);
abstract member MoveItem : string * string -> unit
override this.MoveItem : string * string -> unit
Protected Overridable Sub MoveItem (path As String, destination As String)

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 ProviderCapabilities 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 destination exists and is a container then Force isn't required and path should be moved into the destination container as a child.

The default implementation of this method throws an PSNotSupportedException.

Applies to