"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" -Command Start-Process "$PSHOME\powershell.exe" -Verb RunAs -ArgumentList "'-NoExit %~dp0\AppPoolActivation.ps1'
So you have a batch file, which starts powershell instance, which starts another powershell instance as Administrator, which executes AppPoolActivation.ps1
script?
Why wouldn't you just put PowerShell.exe
in Program/Script field in Task Properties and use -ExecutionPolicy Bypass -File C:\T\AppPoolActivation.ps1
as argument? I doubt that you need to run PowerShell as admin to make web request. And if this issue would still persist, this will make debugging it way easier.