I noticed that the ‘Invoke PowerShell’ activity on the Windows target framework still has not been fixed.
I need to run this script in PowerShell, which works perfectly on the Windows-Legacy target framework:
“Get-AipFileStatus -Path C:\Users\User\Downloads\test.xlsx | ConvertTo-Json”
Unfortunately, it does not work when converted or created as a new project on the Windows target framework.
The guys from UiPath always suggest adding an Execution Policy to the script. I can assure you that such modification still does not work:
“Set-ExecutionPolicy Unrestricted -Scope CurrentUser
Get-AipFileStatus -Path C:\Users\User\Downloads\test.xlsx | ConvertTo-Json”
Finally, I succeeded in running this script by targeting PowerShell 64-Bit with this modification of the code:
“$powershell32 = $env:SystemRoot + ‘\SysWOW64\WindowsPowerShell\v1.0\powershell.exe’
& $powershell32 Get-AipFileStatus -Path ‘C:\Users\User\Downloads\test.xlsx’ | ConvertTo-Json”
The problem is that it takes ~40+ seconds on the Windows target framework, in comparison with ~7 seconds on Windows Legacy.
Questions:
- Are there any other ways to run this script more efficiently and faster?
- Question for the UiPath team: When are you planning to fix the Invoke PowerShell activity?