Invoke PowerShell issues in UIPath Studio

I have a script that works well in power shell and want to add it in uipath. I do not have something right in uipath but it works native in power shell

THis is what I am running in powershell:

$Path = “c:\Temp”
$LogPath = “c:\temp”
Get-ChildItem $Path -force -Recurse | Select Name,@{Name=“Owner”;Expression={(Get-ACL $_.Fullname).Owner}} | Export-Csv $LogPath\FileFolderOwner.csv -NoTypeInformation

This is the error that I am getting.

error
Compiler error(s) encountered processing expression “”$Path = “c:\Temp”
$LogPath = “c:\temp”
Get-ChildItem $Path -force -Recurse | Select Name,@{Name=“Owner”;Expression={(Get-ACL $_.Fullname).Owner}} | Export-Csv $LogPath\FileFolderOwner.csv -NoTypeInformation"".
Character constant must contain exactly one character.

How do I get this to work?

the error is from running in UiPath invoke powershell

This resolves the issue. The correct way to invoke powershell

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.