1

我目前无法在我拥有的 unattend.xml 文件中运行 powershell 脚本。powershell 应该安装应用程序,但 xml 文件似乎无法运行脚本的行。

<FirstLogonCommands>我在使用,<RunSynchronousCommand>和之间来回走动<SynchronousCommand>

<FirstLogonCommands>
   <SynchronousCommand wcm:action="add">
    <CommandLine>Powershell -ExecutionPolicy ByPass -File \\deploy\RemoteInstall\WdsClientUnattend\deploySoftware.ps1</CommandLine>
    <Description>Installs software</Description>
    <Order>1</Order>
   </SynchronousCommand>
</FirstLogonCommands>

该命令应该运行从我们的服务器安装应用程序的 ps1 脚本。

4

1 回答 1

1

我不确定问题是什么,但如果不需要在 autounattend.xml 文件中包含命令,我建议您尝试将命令放入\sources\$OEM$\$$\Setup\Scripts\安装完成.cmd文件。

先用powershell命令制作cmd文件,像这样

PowerShell.exe /W Normal -ExecutionPolicy Bypass ...

然后通过手动运行它来测试它是否正常工作。如果是这样,请将其放在上述目录中,然后再次尝试安装 Windows。

于 2019-07-04T11:26:36.190 回答