I'm working on getting our Windows 10 image ready for provisioning. Per documentation around the Internet you generate an xml file and run the Import-StartLayout command to import it. Whenever I try to run it via a provisioning task I get the following error:
The term 'Import-StartLayout' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
If I run this manually as myself or as Local System from a powershell prompt it works fine. But when it runs through any Endpoint Manager task it fails with this error. I found someone having a similar issue here Run powershell and DISM in OS provisioning but when I try the steps listed here I can't get past this error. I've tried running the command directly as a provisioning task, creating a distribution package as a powershell or batch script, and running the task as Local System, a domain admin user, or the currently logged in user. I've also tried adding the Import-Module StartLayout listed in the bottom comment and that also doesn't work. I'm at a loss at this point on what to do there. Is there something about running Powershell scripts via Endpoint Manager here that I am missing? I've tried this on Windows 10 1703 and 1709 and both do this. We are running Endpoint Manager 2016.3.