On the General tab of the scheduled task, select "Run whether user is logged on or not" to ensure the task does not pop up a window.

To do the same thing in PowerShell, use -LogonType S4U for the task principal configuration. Example below:
$action = New-ScheduledTaskAction -Execute notepad.exe
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(1)
$principal = New-ScheduledTaskPrincipal -UserID "NT AUTHORITY\SYSTEM" -LogonType S4U -RunLevel Highest
Register-ScheduledTask -TaskName "Test1337" -TaskPath "\" -Action $action -Trigger $trigger -Principal $principal
Tested and confirmed on Windows Server 2016 build 1607 (and many other versions by way of previous deployments using this same method).