Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Created July 11, 2016 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mczerniawski/5d9ac4cb9974a206708af18feafa05ad to your computer and use it in GitHub Desktop.
Save mczerniawski/5d9ac4cb9974a206708af18feafa05ad to your computer and use it in GitHub Desktop.
$XMLFile = Get-Content $TemplateUnattendFile -Raw
$XmlFileOutput = $XMLFile.Replace('unattendAdministratorHere',$LocalAdministrator).Replace('unattendPasswordHere',$LocalAdministratorPassword)
if (-not (Test-Path (Split-Path $OutputUnattendFile -Parent))) {
$null = New-Item (Split-Path $OutputUnattendFile -Parent) -ItemType Directory
}
$XmlFileOutput | Out-File $OutputUnattendFile -Force utf8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment