ErrorDetails Constructor (IResourceSupplier, String, String, Object)
Updated: April 27, 2016
Applies To: Windows PowerShell
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.
Assembly: System.Management.Automation (in System.Management.Automation.dll)
public ErrorDetails( IResourceSupplier resourceSupplier, string baseName, string resourceId, params object args )
- Type: System.Management.Automation.IResourceSupplier
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.
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.