Write files to folder with different user rights

Discuss RoboTask here
sarnusch
Posts: 35
Joined: Thu Apr 28, 2022 9:05 am

Re: Write files to folder with different user rights

Post by sarnusch »

I will now solve the problem by running a copy process with the appropriate permissions using a power shell script and the action 'PowerShell Script'.
That works fine after a few tests.

Code: Select all

$Source = "PATHA"
$Dest   = "PATHB"
$Username = "{USR}"
$Password = ConvertTo-SecureString "{PWD}" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential($Username, $Password)
New-PSDrive -Name K -PSProvider FileSystem -Root $Dest -Credential $mycreds -Persist
Copy-Item -Path $Source -Destination $Dest
Remove-PSDrive -Name K
Post Reply