These states are used to perform any actions in the Windows machines of a private network using PowerShell commands.
There are six states available in the PowerShell Task Engine for performing different operations.
PowerShell Engine
Install WindowsApp
Uninstall WindowsApp
Start Service
Stop Service
Restart WindowsServer
An active Bridge agent. Refer here to install and configure Bridge.
Create necessary Credentials for the applications to be connected by PowerShell Task Engine.
Executes an attached PowerShell script file on the Windows machine in a private network.
Drag and drop the required PowerShell Engine state from the left pane into your circuit or click the required state in your circuit.
Under Configuration, update the common state field attributes.
In Bridge ID, click and select the Bridge to be configured to the state from the drop-down list.
Under the Add Configuration section, fill in the following fields:
Credential ID - Select the credential from the dropdown list. The Credential ID of all the credentials created for the SSH module type will be displayed in the list.
Script ID - Select the name of the Script to be executed. To create a new script file, navigate to Scripts.
Host - Enter the hostname of the machine in which the shell command has to be executed. Enter the hostname as localhost, if the shell command is executed on the same Bridge-installed machine.
Under the Variable section, click Add. The field will expand and allow you to add variables that need to be executed in the PowerShell script. Enter a variable name and its param value.
Under the Add Credentials section, click Add to enter the credentials of any Windows machine that has to be connected through the PowerShell script.
Var name - Provide a name for the credential.
Name - Select the credential name from the dropdown list that needs to be connected through the PowerShell script.
"Windows OS Installation": {"type": "powershell_engine","next": "Licence Key Activation-Windows","start": true,"bridge_id": "Bridge_1368_1","payload": {"credential_id": "PWSH Credential for OS installation","script_id": "Script-OSinstall","host": "localhost","variables": {"os_filename": "windows.iso"},"credentials": [{"variable": "Windows_SK01","credential_id": "psh_cred_5"}]}}
This state allows users to install apps in Windows machines using PowerShell.
This state can be configured in Builder View by entering the MSI file location of the app to be installed in the MSI Filepath field under the Add Configuration section in addition to the common field attributes.
"Install an Application": {"type": "install_windows_app","next": "End","start": true","bridge_id": "bridge-employee onboarding","payload": {"credential_id": "PWSH Credential for OS installation","host": "localhost","msi_file_path":"C:\\Users\\Administrator\\Downloads\\tortoisehg-5.8.0-x64.msi"}}
An existing app can be uninstalled from the Windows machine using this state.
To uninstall an app from the Windows machine, in Builder View, fill in the common state field attributes. Under Add Configuration, in App Name, enter the name of the app to be uninstalled from the Windows machine.
In Code View, the JSON to uninstall a Windows app using a PowerShell task in Circuit is given below:
"Uninstall Windows App": {"type": "uninstall_windows_app","next": "End","start": true,"bridge_id": "<bridge_name>","payload": {"credential_id": "<credential_name>","host": "<host_name>","app_name": "<application_name>"}}
"Start App Management Service": {"type": "start_service","next": "End","start": true,"bridge_id": "bridge-1368_1","payload": {"credential_id": "pwsh_cred_5","host": "localhost","service_name": "AppMgmt"}}
A service running in the backend Windows server can be stopped with this state.
To configure the Stop Service state in Builder View, fill in the common state field attributes. Under Add Configuration, in the Service Name field, enter the name of the service that has to be stopped on the Windows machine.
In Code View, the following JSON is used to stop a service using the PowerShell engine task in circuit:"Stop a Service": {"type": "stop_service","next": "End","start": true,"bridge_id": "<bridge_name>","payload": {"credential_id": "<credential_name>","host": "<host_name>","service_name": "<service_name>"}}
This state is used to restart the Windows server operating system, which stops all running processes and services on the server, followed by a complete system reboot. It is often done to apply system updates, resolve issues, or perform routine maintenance tasks.
To configure the state in Builder View, under Add Configuration, select the Credential ID and enter the Host name of the Windows machine that has to be restarted.
In Code View, the following JSON is used to restart a Windows server:
"Restart WindowsW10": {"type": "restart_windows_server","next": "End","start": true,"bridge_id": "<bridge_name>","payload": {"credential_id": "<credential_name>","host": "host_name>"}}
You are currently viewing the help articles of Qntrl 3.0. If you are still using our older version and require guidance with it, Click here.