I want to execute below powershell using “Invoke powershell activity”. This script is running fine while running outside of uipath however while executing same through uipath, I am getting “Command not Found” exception. Please help.
Did same but facing same issue. I have copied entire exception from catch block and have pasted below.
Transaction error execution started
System.Management.Automation.CommandNotFoundException: The term '$Outlook = New-Object -ComObject Outlook.Application
$Mail = $Outlook.CreateItem(0)
$Mail.HTMLBody = $html
$Mail.Send()’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Transaction error execution ended in: 00:00:01