Skip to content
DocsTry Aspire
DocsTry

PowerShellScriptResource Constructors

ClassConstructors2 members
Represents a PowerShell script resource.
Constructor(string, ScriptBlock, PowerShellRunspacePoolResource)Section titled Constructor(string, ScriptBlock, PowerShellRunspacePoolResource)
Initializes a new instance of the PowerShellScriptResource class, representing a resource for executing PowerShell scripts.
public class PowerShellScriptResource
{
public PowerShellScriptResource(
string name,
ScriptBlock script,
PowerShellRunspacePoolResource parent)
{
// ...
}
}
namestringThe name of the resource. This must be a valid resource name.
scriptScriptBlockThe ScriptBlock to be executed.
parentPowerShellRunspacePoolResourceThe parent PowerShellRunspacePoolResource that provides the runspace pool for script execution. Cannot be null.
This class is designed to manage the execution of PowerShell scripts within a specified runspace pool. The script execution is tied to a cancellation token, allowing the script to be stopped when requested.
Constructor(string, FileInfo, PowerShellRunspacePoolResource)Section titled Constructor(string, FileInfo, PowerShellRunspacePoolResource)
Initializes a new instance of the PowerShellScriptResource class, representing a resource for executing PowerShell scripts.
public class PowerShellScriptResource
{
public PowerShellScriptResource(
string name,
FileInfo scriptFile,
PowerShellRunspacePoolResource parent)
{
// ...
}
}
namestringThe name of the resource. This must be a valid resource name.
scriptFileFileInfoThe file containing the PowerShell script to be executed. Must be a valid file path and not null.
parentPowerShellRunspacePoolResourceThe parent PowerShellRunspacePoolResource that provides the runspace pool for script execution. Cannot be null.
This class is designed to manage the execution of PowerShell scripts within a specified runspace pool. The script execution is tied to a cancellation token, allowing the script to be stopped when requested.