Whenever I execute a procedure that uses PowerShell, Kaseya takes forever to run the procedure. Any other procedure works fine and runs instantly, however, any procedure that uses power shell takes over an hour at least.
Any help is appreciated.
Are you using the executePowershell step and calling a powershell script directly?
Does it only happen on specific PS Scripts or ALL?
Can you provide one of your scripts for us to try it out?
What version of VSA are you running?
Thanks for the response. I'm not using the execute powershell step, I am writing the file, and executing shell command.
This issue has occured on the couple of powershell schripts I have tried. We are running the latest version of the VSA (220.127.116.11)
The other script I had used the execute powershell step and had the same issue.
you can try to
powershell -ExecutionPolicy ByPass "& "C:\kworking\get_folder_size.ps1"
plz notice, it's using 3 double quotes. and/or you can try :
"execute as system" on line 2
if it still failed, you can posting agent procedure log here
Hi Asep Suandi
Thank you for the reply. I can give that a shot. Why would that cause the delay issue I am seeing? The scritps aren't failing it is just the take a crazy long time to execute. For example, the first time I ran the powershell script on my pc it took 2 hours to execute on my system.
The other thing that may be happening, because you are "Executing as User" is it may be waiting for a UAC confirmation that never gets clicked, thus causing the procedure to time out. Do you need to Execute as User, or could you Execute as System?
Another thing is to try the syntax "powershell.exe -nologo -executionpolicy bypass -noprofile -file "PATH_TO_FILE""