Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ErrorDetails Constructor (IResourceSupplier, String, String, Object[])

Initializes a new instance of the ErrorDetails class that contains a localizable version of a message based on a template string supplied by a Windows PowerShell provider.

Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

Dim resourceSupplier As IResourceSupplier
Dim baseName As String
Dim resourceId As String
Dim args As Object()

Dim instance As New ErrorDetails(resourceSupplier, baseName, resourceId, args)

public ErrorDetails (
	IResourceSupplier resourceSupplier,
	string baseName,
	string resourceId,
	params Object[] args
public ErrorDetails (
	IResourceSupplier resourceSupplier, 
	String baseName, 
	String resourceId, 
	Object[] args
public function ErrorDetails (
	resourceSupplier : IResourceSupplier, 
	baseName : String, 
	resourceId : String, 
	... args : Object[]



An IResourceSupplier interface that represents the resource supplier. This entity is usually an instance of CmdletProvider.


The root name of the resource manager. By default, this is the name of the ResourceManager.


The resource identifier that is specified by the Root name. By default, this is the identifier that is specified in the ResourceManager.


The arguments that are needed to translate the string. By default, Format is used to translate strings.

This constructor is a shortcut to build an instance of an ErrorDetails class by using the steps that are typically used to generate a localizable string. It is the preferred constructor over ErrorDetails(String) because of the localizable information about the error.

The replacement message text should conform to the .NET Framework design guidelines for writing exception messages with only small differences. Those guidelines state that exception messages should be targeted for developers. In contrast, these replacement messages should be targeted at the users of your cmdlet.

Cmdlet providers can override the behavior of this constructor by overriding the GetResourceString method. This is the first call the constructor makes to load a template string.

For more information about error records, see Windows PowerShell Error Records.


Target Platforms

© 2015 Microsoft