UiPath Invoke Power Shell Script Not Working

I’m creating a Power Shell Script that runs as expected when executed directly in Power Shell. However, when I try to run it using the Invoke Power Shell activity in UiPath, I encounter an error. Please find the error details and screenshot attached.

ERROR: Invoke Power Shell: The ‘Get-Printer’ command was found in the module ‘PrintManagement’, but the module could not be loaded. For more information, run ‘Import-Module PrintManagement’.

image

@madhabhazra0,

Have you enabled Is script property?

yes, IsScript property is enabled already

If you are allowed to share, can you share the script you are using? I will try to replicate the issue.

Thanks,
Ashok :slightly_smiling_face:

sorry , I can’t share the script.
script is working fine.
using UiPath invoke power shell it failed

@madhabhazra0

Try the execution policy

cheers