PsrpOperator

PSRP

PowerShell Remoting Protocol operator.

View on GitHub

Last Updated: Jan. 3, 2023

Access Instructions

Install the PSRP provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

psrp_conn_idRequiredconnection id
commandcommand to execute on remote host. (templated)
powershellpowershell to execute on remote host. (templated)
cmdletcmdlet to execute on remote host (templated). Also used as the default value for task_id.
argumentsWhen using the cmdlet or powershell option, use arguments to provide arguments (templated).
parametersWhen using the cmdlet or powershell option, use parameters to provide parameters (templated). Note that a parameter with a value of None becomes an argument (i.e., switch).
logging_levelLogging level for message streams which are received during remote execution. The default is to include all messages in the task log.
runspace_optionsoptional dictionary which is passed when creating the runspace pool. See RunspacePool for a description of the available options.
wsman_optionsoptional dictionary which is passed when creating the WSMan client. See WSMan for a description of the available options.
psrp_session_initOptional command which will be added to the pipeline when a new PowerShell session has been established, prior to invoking the action specified using the cmdlet, command, or powershell parameters.

Documentation

PowerShell Remoting Protocol operator.

Use one of the ‘command’, ‘cmdlet’, or ‘powershell’ arguments.

The ‘securestring’ template filter can be used to tag a value for serialization into a System.Security.SecureString (applicable only for DAGs which have render_template_as_native_obj=True).

When using the cmdlet or powershell arguments and when do_xcom_push is enabled, the command output is converted to JSON by PowerShell using the ConvertTo-Json cmdlet such that the operator return value is serializable to an XCom value.

Was this page helpful?