When i try to use power shell integrate with Microsoft am getting the following error(Please see the attached screenprint) when i use this command ‘Connect-MsolService’ none of the Microsoft commands are not working
Please advice on this.i dono whether am making mistake in selecting the Type Argument.
i tried with all the following below commands in Invoke Powershell Activty but none of the things gave me a luck
1.set-executionpolicy unrestricted
2. Set-ExecutionPolicy RemoteSigned
Whether i need to select any particular ‘TypeArgument’ for Invoke Powershell Activty ?
Please advice on this i attached the screen print of the error.
Hi Arun
Here I cannot helt you, as I do not know these commands and the usage, but I think you cannot execute the command because it is not available for you (e.g. that the AzureAD module is not installed - try to execute the commands directly in your PowerShell prompt).
Best of luck - maybe others have input to your request.
BR, MMC
Any luck here @arunshiva? I’m having the same issue currently and have tried all the above without success
The stranger thing is, I can run the “connect-msolservice” command without issue in an elevated Powershell session and it’ll connect just fine, but the moment I run that same command in UIPath, it says it cannot be found - even if I manually type it in the prompt that UI Path opens,it fails.
Powershell is currently set to always start as Admin… also tried running UIPath in admin too to see if that would get it to move the needle but to no success. The module is definitely installed as otherwise it wouldn’t work each time I open powershell manually and enter it.
Would appreciate any tips, troubleshooting methods, or similar that could help here.
No there is some problem with executing a commands in UiPath and also i could not find a demo class or a session video for Power Shell Activity also in UiPath Academy.
@ovi i think she is the right person to guide us regarding this blog.
Going to tag @loginerror as well since he’s also been quite helpful in my experience with assisting in resolving issues. Are you able to direct this to anyone who can assist?
The behavior is extremely strange considering it only happens when UI Path launches the Powershell application thus it has to be the fault of however UI Path runs the powershell application/scripts. Manually running Powershell and entering this command doesn’t have a single issue, nor does saving it as a script and running it - the only way it fails is through Studio.
I’ll put in a ticket as well through work here since we have access to the support team via a license/certified UI Path partnership.
Thank you for also logging a ticket with our support.
Maybe I didn’t get the full picture, but could you clarify:
does it also fail if you run the PowerShell as an application from within UiPath and surface automate it with your commands (in contrary to using the Invoke Power Shell Activity)?
The fact that an activity cannot execute a command that works manually is definitely a sign of a buggy behaviour and we will investigate.
Does it also fail if you run the PowerShell as an application from within UiPath and surface automate it with your commands (in contrary to using the Invoke Power Shell Activity)?
It fails every time when you run it from UI Path using any of the following:
Invoke PowerShell (IsScript checked)
Start Process (Using: C:\Windows\System32\WindowsPowershell\v1.0\Powershell.exe + with an attribute of “Run As Administrator” checked)
Start Application (Powershell) and then manually entering the command in once it’s opened from UI Path
The only successful way we can make the process work as intended is loading Administrator Powershell from the start menu and typing it in. All the other approaches throw the same error.
Hi everyone,
I`m afraid that there is a limitation here.
The problem lies with the fact the the UiPath Executor runs with normal rights.
The script that you are attempting to run requires elevation.
For now, unless you hack the UiPath Excecutor process to start up with elevated rights (not something we encourage or support… yet) the invoke powershell activity will not be able to run scripts which require elevation - including of course, ones that try to elevate the executor itself.
Now, were you to run these scripts in attended mode, you could create the scripts in such a way that the you get a prompt requiring elevation of the process - the famous Windows “Requires Elevation” window.
However, in unattended mode, the robot will not be able to interact with the window as there is no admin there to accept its elevation. I hope this makes sense.
Still, so as to not end in a negative tone, the Developers covering this part of the code (really smart guys) have already begun developing a feature that will allow just this, as there are quite a few situations where elevating the executor is mighty useful. This feature is coming, but Im afraid I dont know exactly when it will be ready.