Invoke powershell unable to recognized aws keyword

Hi @Naveen.Ch and @marian.platonov,

As @marian.platonov rightly noted. This is the correct reason why cmdlets are not recognized by Invoke PowerShell.

Why though? - User vs System PowerShell

  • If you are using Windows version of UiPath Project, the PowerShell exe used by Invoke PowerShell is the one linked to your user
    C:\Users\YOURUSERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell

    So this forces the Robot user to also have the same module installed and since it does not have access to system level modules you installed in your robot server / vdi / vm. Your modules may be installed in C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe scope.

  • If you are using Windows Legacy version of UiPath Project, the PowerShell exe used by Invoke PowerShell activity is the one linked to your system.
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

You might have installed your module in one, but the other one does not have that module installed so the Robot / UiPath fails at the Invoke PowerShell activity.

Two weeks ago we found this out the hardway. Our AD module worked great on Windows Legacy project. We wanted to start using windows, but the documentation did not highlight that doing so has many unwanted consequences (for example Read/WriteText File, Read/Write CSV activities break, if you try to use workflows from windows legacy in your windows project)

1 Like