The problem here is that MS removed the "Interact with the desktop" from the scheduled task parameters.
If you search for "windows 10 scheduled task interact with desktop" you'll find lots of people with the same problem.
Some of the sugestions might work for you (e.g. have the task run using "builtin\users" and "Run with highest privileges", or use the schedtask command with the "change" option and the "/IT" parameter). There are others, too. But the reason MS removed that "interact" option is that it's a big security problem.
This really isn't a PowerShell problem, though . . . or a Windows 10 problem. It affects all server products (from 2016 I think) onward, and desktops from 10 onwards.