Error details : Invoke Power Shell: PowerShell command errors:
: A parameter cannot be found that matches parameter name ‘Un’.
+ CategoryInfo : InvalidArgument: ( [MSOnline.ps1], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : NamedParameterNotFound,MSOnline.ps1
I’m actually passing all as parameters : Botusername, Password, Un but unable to find root cause for this.
You probably will need to also check if the code/script runs in your PowerShell instance before running it in UiPath.
The error is in the -Un $Un PowerShell is not able to identify -Un as an argument in the $PowerShell64bitExe. Your piped object and Select-Object is where the error originates.
@jeevith : Script is working fine when i am running MSOnline.ps1 script manually. I’ve passed all three parameters manually to PowerShell screen and got the expected output.
I am assuming that we can pass three mandatory parameters in Invoke PowerShell activity. If i replace this command "Get-MsolUser -UserPrincipalName $Un | select Licenses " with different command “Get-MsolAccountSku” then it is working fine.