Skip to content
Docs Try Aspire

PowerShellScriptResource Constructors

Class Constructors 2 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)
{
// ...
}
}
name string The name of the resource. This must be a valid resource name.
script ScriptBlock The ScriptBlock to be executed.
parent PowerShellRunspacePoolResource The 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)
{
// ...
}
}
name string The name of the resource. This must be a valid resource name.
scriptFile FileInfo The file containing the PowerShell script to be executed. Must be a valid file path and not null.
parent PowerShellRunspacePoolResource The 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.