Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

PSEnsure2

Calls a PowerShell Ensure Script that is stored as an asset.

Script usage:

PSEnsure(
	Name: <text>,
	[Parameters: <%(key1: value1, ...)>],
	[InputVariables: <%(key1: value1, ...)>],
	[OutputVariables: <@(text)>],
	[PreferWindowsPowerShell: <text>],
	[ScriptText: <text>]
);

This operation may be prefixed with PowerShell::, although this is a built-in namespace and isn't really necessary.

Arguments:

NameFormatScript UsageUsage Notes
Name (default)
text
Name
The name of the script asset. This argument is required.
Parameters
%(key1: value1, ...)
Parameters
InputVariables
%(key1: value1, ...)
InputVariables
OutputVariables
@(text)
OutputVariables
Prefer Windows PowerShell
text
PreferWindowsPowerShell
When true, the script will be run using Windows PowerShell 5.1 where available. When false or on Linux (or on Windows systems without PowerShell 5.1 installed), the script will be run using PowerShell Core instead.
ScriptText
text
ScriptText

Example:


# execute the EnsureLocalAdmin.ps1 ensure script
PSEnsure EnsureLocalAdmin.ps1
(
  Parameters: %(User: $PSCredential(defaultAdminAccount), Enabled: false)
);