Export (0) Print
Expand All
Expand Minimize

Converting the Windows Script Host GetResource Method


Windows PowerShell


Definition: Returns the value of a resource defined with the <resource> element.

GetResource


The GetResource method is reserved for use with Windows Script Files (.WSF files), and is primarily used as a way to localize a script: it enables you to define a set of strings (for example, an error message localized into several different languages) and then retrieve a specific value using an assigned – and unique – resource ID. The initial release of Windows PowerShell does not include anything similar to GetResource. However, the Community Technology Preview (CTP) release of Windows PowerShell 2.0 features a data section that does something similar: it enables you to separate your actual scripting code from resource information such as error messages. For more information about the data section, see the Windows PowerShell online help.


See conversions of other Windows Script Host methods and properties.
Return to the VBScript to Windows PowerShell home page

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft