Я собираю машину win10 через USB, но когда она загружается в первый раз на рабочий стол, запускается только первый скрипт (всплывающее уведомление). Вот фрагмент моего Unattend.xml
:
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Pop out nOtification</Description>
<Order>1</Order>
<CommandLine>powershell Add-Type -AssemblyName PresentationFramework; [System.Windows.MessageBox]::Show('Make sure the computer is connected to the unauth port before continuing!!')</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Description>Rename and Join Computer to Domain</Description>
<Order>2</Order>
<CommandLine>powershell Add-Type -AssemblyName Microsoft.VisualBasic; $COMPNAME = [Microsoft.VisualBasic.Interaction]::InputBox('Enter New Name', 'Rename Computer'); $OLDNAME = hostname; $CRED = Get-Credential -Message 'Enter admin credential'; $OUPATH = 'OU=Windows10,OU=LTCP User Computers,DC=domainhere,DC=com'; write-host ' after a restart'"`n"; Add-Computer -DomainName "domain.com" -ComputerName $OLDNAME -NewName $COMPNAME -Credential $CRED -OUPath $OUPATH; write-host "`n"'Join sucessful, machine is in WIN10 OU.. restarting in 10s' -ForegroundColor Yellow; Start-Sleep 10; Restart-Computer</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
</FirstLogonCommands>
Я проверил, что скрипт отлично работает в PowerShell ISE. Кто-нибудь знает, почему это происходит?