I'm running a batch file including the below command from the scheduled task using Bamboo. But I'm not able to process it because it is being stuck.
I have no idea what Bamboo is or does. You might want to explain more about that and how it is being used.
In the Task Scheduler, define the task to run as an account that is a member of the administrators group. To prevent UAC issues, select "run with highest privileges".
https://www.digitalcitizen.life/use-task-scheduler-launch-programs-without-uac-prompts/
powershell.exe -noprofile -NoExit -command "&{start-process powershell -ArgumentList '-NoExit -noprofile -file \"%~dp0psfile.ps1\"' -verb RunAs}"
You don't need to do that. Just have the 1st PS run the script.
powershell.exe -noprofile -file "%~dp0psfile.ps1"
You may also need to add an execution policy if you have not set it globally.
powershell.exe -noprofile -ExecutionPolicy Bypass -file "%~dp0psfile.ps1"
Normally you would not want to use -NoExit switch because that will leave Powershell.exe running after the script has terminated. You'll end up with a bunch of PS exe's running and doing nothing other than using up memory.