How can I run Powershell cmdlet from UiPath Windows workflow?

Powershell works fine in a VB Windows-Legacy project, but when I create and try to run the same Powershell cmdlet in a UiPath C# Windows project I receive the following error:

Invoke PowerShell

Invoke Power Shell: The term ‘Start-ScheduledTask’ is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

How can I run the cmdlet (i.e. Start-ScheduledTask) from the Invoke Power Shell activity?
Or is there a better way to start a scheduled task from UiPath?

1 Like

I resolved this issue by using the Start Process UIAutomation activity and invoking powershell and the script to be run.

It would be cleaner if I could directly run a powershell command or script from within UiPath, if anyone knows how to do that.

Additional Information:
Framework: C#, Windows.

Hi @grosner,

Thanks for sharing the solution.

Opening a new topic for this will allow you to get faster support.

Regards,
MY

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.