From 59cedf40f42c3f5601389674f6318c06ff1bcba4 Mon Sep 17 00:00:00 2001 From: dsx42 Date: Sat, 16 Jul 2022 16:56:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=B8=8D=E8=BF=87=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UnattendTool.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/UnattendTool.ps1 b/UnattendTool.ps1 index 3b3e891..8c739a6 100644 --- a/UnattendTool.ps1 +++ b/UnattendTool.ps1 @@ -1501,10 +1501,18 @@ Add-Content -Path $UnattendPath -Value ' ' Add-Content -Path $UnattendPath -Value '' Add-Content -Path $UnattendPath -Value ' ' Add-Content -Path $UnattendPath -Value ' ' -Add-Content -Path $UnattendPath -Value (' cmd /c del /f /q %WINDIR%\Panther' + ` - '\unattend.xml') Add-Content -Path $UnattendPath -Value ' 1' +Add-Content -Path $UnattendPath -Value (' cmd /C del /f /q %WINDIR%\Panther' ` + + '\unattend.xml') Add-Content -Path $UnattendPath -Value ' ' +if ($Password) { + Add-Content -Path $UnattendPath -Value '' + Add-Content -Path $UnattendPath -Value ' ' + Add-Content -Path $UnattendPath -Value ' 2' + Add-Content -Path $UnattendPath -Value (' cmd /C wmic useraccount' ` + + " where 'Name=`"$FullName`"' set PasswordExpires=false") + Add-Content -Path $UnattendPath -Value ' ' +} Add-Content -Path $UnattendPath -Value ' ' Add-Content -Path $UnattendPath -Value ' ' Add-Content -Path $UnattendPath -Value ' '