Need to run PowerShell as Admin

@john.mari

To run PowerShell as an administrator in UiPath, you can use the “Start Process” activity and pass the required arguments to it. Here’s how you can do it:

  1. Add the “Start Process” activity to your UiPath workflow.

  2. In the “FileName” property of the activity, enter “powershell.exe” to start the PowerShell application.

  3. In the “Arguments” property, enter the following command to run PowerShell as an administrator:

-Command "& {Start-Process PowerShell -Verb RunAs}"

This command starts a new PowerShell process with elevated privileges.

  1. Optionally, you can set the “WorkingDirectory” property to the directory where you want the PowerShell process to start.

Here’s an example workflow to help you understand better:

In this example, the workflow starts PowerShell as an administrator and runs the “Get-Process” cmdlet to retrieve information about the currently running processes. The output is then displayed in a message box.

Note that when you run PowerShell as an administrator, you may be prompted to provide administrator credentials