PowerShell Activity

Workflow Studio supports workflow activities that can execute PowerShell cmdlets and retrieve results inside the same Workflow. The capability to execute PowerShell cmdlets makes it easier to implement custom use cases/scenarios that cannot be handled via out-of-the-box connectors and workflows.

The AzXPowerShellActivity is the workflow activity that allows developers to execute the cmdlets found in the following PowerShell modules:

  • AzureAD

  • EXO V2

  • MSOnline

  • MSTeams

  • SharePointOnline

The AzXPowerShellActivity will also soon support Graph PowerShell cmdlets too.

The AzXPowerShellActivity Activity relies upon the microservices running in the Azure tenant where the cmdlets are to be executed. There are microservices for each type of cmdlets supported by the AzXPowerShellActivity.

 

  • Developers can pass the commands and specify which microservice will handle the script execution in the AzXPowerShellActivity inside any workflow.

  • The AzXPowerShellActivity calls the SCIM connector to authenticate the user executing the command. The AzXPowerShellActivity exposes a property that allows setting the account store,

  • The SCIM microservice will then pass the commands to the microservice. The microservice will execute the commands in azure resources. The Workflow receives the results from the execution of the command. E.g., we can add an activity to execute the Add-TeamUser command and specify to run it in MS Teams PowerShell microservice. The specific microservice will execute the command and return the results to the Activity.

Important Properties

The Major properties of TheDotNetFactory.Framework.PowerShell class are

Properties

Description

Properties

Description

IsScript

IsScript is a boolean value indicating if the command text is the script.

CommandText

CommandText is a valid PowerShell command supported by the azure resource.

 

The major properties of the AzXPowerShellActivity class are

Properties

Description

Properties

Description

PSServiceType

PSServiceType sets which microservice executes the current PowerShell script.

AccountStoreID

AccountStore that can authenticate the current user executing the PowerShell commands.

Commands

List of commands of type PSCommand.

RestrictDelayToSameServer

Set to True if any delay in the Activity should resume on the same workflow server that initiated the delay.

EnablePassiveResultsHandling

Set to True if the Activity should use the goto idle until results are available.

 

 

 

 

 

Â