The UAC settings in that OS are probably configured to prompt, hence the requirement to run it from an interactive session.
You can check with
$path='HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System'
Get-ItemProperty-Path $path-Name *