Powershell script launched from Kace Scripting crashes
I have a PowerShell script that copies select folders from a user's profile (Desktop, Documents, Chrome default user data folder, etc) from their computer to a new/replacement computer. The script functions perfectly running on its own but when I have it run out of Kace it fails. THe script does require input and it runs fine through that part, launching PowerShell on the computer I set it to run on in kace but as soon as it hits the point to begin the copy PowerShell either crashes (when running as local system) or throws access denied errors (when running as current user). I have tried adding credentials to the script in multiple ways with no improvement. I have run out of ideas, I really need this to be able to run out of the kace scripting so it is available to my whole Dept continuously. Any help would be greatly appreciated.
It would be helpful if you provided your script. I found that with kace you must start the 64bit version of powershell manually for some scripts. This has worked for me:
set-executionpolicy bypass -force
Set-Alias Start-PowerShell64 "$env:windir\sysnative\WindowsPowerShell\v1.0\powershell.exe"
(powershell script starts here)