Is there a way to execute Powershell 'as administrator' from command line? When I open a command window on the Server and select 'Run As Administrator' then run my main script that then calls this script it works great. If I try and schedule the main script in Task Scheduler this part doesn't run. Thus was thinking a permissions issue. Not really sure as nothing writes to my log file......
if not exist %ARCHIVEDIR%\PBCS\Backups\%Timestamp% mkdir %ARCHIVEDIR%\PBCS\Backups\%Timestamp%
powershell.exe -Command "Get-ChildItem '%Source%' | Compress-Archive -DestinationPath '%Target%' -Force"