Udostępnij za pośrednictwem


ItemCmdletProviderIntrinsics.New Method

Definition

Overloads

New(String, String, String, Object)

Creates a new item at the given path.

New(String[], String, String, Object, Boolean)

Creates a new item at the given path.

New(String, String, String, Object)

Creates a new item at the given path.

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ New(System::String ^ path, System::String ^ name, System::String ^ itemTypeName, System::Object ^ content);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> New (string path, string name, string itemTypeName, object content);
member this.New : string * string * string * obj -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function New (path As String, name As String, itemTypeName As String, content As Object) As Collection(Of PSObject)

Parameters

path
String

The path to the container to create item in. It may be a drive or provider-qualified path and may include glob characters.

name
String

The name of the new item to create.

itemTypeName
String

The type of the new item to create.

content
Object

The content of the new item to create.

Returns

The item that was created.

Exceptions

If path or propertyToClear is null.

If the path refers to a provider that could not be found.

If the path refers to a drive that could not be found.

If path does not contain glob characters and could not be found.

If the provider that the path refers to does not support this operation.

If the provider threw an exception.

Applies to

New(String[], String, String, Object, Boolean)

Creates a new item at the given path.

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ New(cli::array <System::String ^> ^ path, System::String ^ name, System::String ^ itemTypeName, System::Object ^ content, bool force);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> New (string[] path, string name, string itemTypeName, object content, bool force);
member this.New : string[] * string * string * obj * bool -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function New (path As String(), name As String, itemTypeName As String, content As Object, force As Boolean) As Collection(Of PSObject)

Parameters

path
String[]

The path(s) to the container to create item in. They may be drive or provider-qualified path and may include glob characters.

name
String

The name of the new item to create.

itemTypeName
String

The type of the new item to create.

content
Object

The content of the new item to create.

force
Boolean

Passed on to providers to force operations.

Returns

The item(s) that was created.

Exceptions

If path or propertyToClear is null.

If the path refers to a provider that could not be found.

If the path refers to a drive that could not be found.

If path does not contain glob characters and could not be found.

If the provider that the path refers to does not support this operation.

If the provider threw an exception.

Applies to