@@ -271,3 +271,64 @@ PARAMETERS
271271 PS C:\>Convert-WIM2VHDX -Path c:\windowsServer.vhdx -WimPath d:\Source\install.wim -index 3
272272 -Size 40GB -force
273273 ```
274+
275+ ```
276+ NAME
277+ New-UnattendXml
278+
279+ SYNOPSIS
280+ Create a new basic Unattend.xml
281+
282+
283+ SYNTAX
284+ New-UnattendXml [-AdminPassword] <String> [-Path <String>] [-LogonCount <Int32>] [-ScriptPath <String>]
285+ [-TimeZone <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
286+
287+
288+ DESCRIPTION
289+ Creates a new Unattend.xml and sets the admin password, Skips any prompts, logs in a set number of times
290+ (default 0) and starts a powershell script (default c:\pstemp\firstrun.ps1).
291+ If no Path is provided a the file will be created in a temp folder and the path returned.
292+
293+
294+ PARAMETERS
295+ -AdminPassword <String>
296+ The password to have unattnd.xml set the local Administrator to
297+
298+ -Path <String>
299+ Output Path
300+
301+ -LogonCount <Int32>
302+ Number of times that the local Administrator account should automaticaly login (default 1)
303+
304+ -ScriptPath <String>
305+ Script to run on autologin (default: %SystemDrive%\PSTemp\FirstRun.ps1 )
306+
307+ -TimeZone <String>
308+ set new machine to this timezone (default Central Standard Time)
309+
310+ -WhatIf [<SwitchParameter>]
311+
312+ -Confirm [<SwitchParameter>]
313+
314+ <CommonParameters>
315+ This cmdlet supports the common parameters: Verbose, Debug,
316+ ErrorAction, ErrorVariable, WarningAction, WarningVariable,
317+ OutBuffer, PipelineVariable, and OutVariable. For more information, see
318+ about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
319+
320+ -------------------------- EXAMPLE 1 --------------------------
321+
322+ PS C:\>New-UnattendXml -AdminPassword 'P@ssword' -logonCount 1
323+
324+
325+
326+
327+
328+
329+ -------------------------- EXAMPLE 2 --------------------------
330+
331+ PS C:\>New-UnattendXml -Path c:\temp\Unattent.xml -AdminPassword 'P@ssword' -logonCount 100 -ScriptPath
332+ c:\pstemp\firstrun.ps1
333+ ```
334+
0 commit comments