Ajout de la langue anglaise
Ajout d'un README.md avec le descriptif et les instructions L'ancien README.md s'appelle désormais CHANGELOG.md Activation du pavé numérique par défaut pour les installations sans assistance Nouveau design pour la fenêtre de déploiement. Ajout de paramètre pour pouvoir procéder à une installation totalement automatisée Ajout de paramètre pour copier au choix sources, drivers ou les deux sur C:\DeployVenter avant leur usage par DISM.
This commit is contained in:
1 parent
cb917c97ce
commit
2212e25d31
26 files changed
+2625
-830
No files matched your search
+30
-22
@@ -1,5 +1,5 @@
|
||||
# DeployCenter - Découverte et génération des profils de réponses Windows.
|
||||
# Les profils PSD1 restent des fichiers de données ; les réponses sont construites comme XML.
|
||||
# DeployCenter - Discover and generate Windows answer-file profiles.
|
||||
# PSD1 profiles remain data files; answer files are built as XML.
|
||||
|
||||
function Get-DeployCenterUnattendProfileNames {
|
||||
[CmdletBinding()]
|
||||
@@ -20,20 +20,20 @@ function Import-DeployCenterUnattendProfile {
|
||||
[Parameter(Mandatory=$true)][string]$ProfileName
|
||||
)
|
||||
|
||||
if ($ProfileName -notmatch '^[A-Za-z0-9_-]+$') { throw "Nom de profil Unattend invalide : $ProfileName" }
|
||||
if ($ProfileName -notmatch '^[A-Za-z0-9_-]+$') { throw "Invalid Unattend profile name: $ProfileName" }
|
||||
$path = Join-Path $ProfilesRoot ($ProfileName + '.psd1')
|
||||
if (-not (Test-Path -LiteralPath $path -PathType Leaf)) { throw "Profil Unattend introuvable : $ProfileName" }
|
||||
if (-not (Test-Path -LiteralPath $path -PathType Leaf)) { throw "Unattend profile not found: $ProfileName" }
|
||||
$profile = Import-PowerShellDataFile -LiteralPath $path
|
||||
foreach ($key in @('Id','Name','Description','Target','Template','ComputerName','LocalAccount')) {
|
||||
if (-not $profile.ContainsKey($key)) { throw ('Le profil Unattend {0} ne contient pas la cle {1}.' -f $ProfileName, $key) }
|
||||
if (-not $profile.ContainsKey($key)) { throw ('Unattend profile {0} does not contain key {1}.' -f $ProfileName, $key) }
|
||||
}
|
||||
if ([string]$profile.Id -ne $ProfileName) { throw ('L identifiant du profil Unattend {0} ne correspond pas au nom du fichier.' -f $ProfileName) }
|
||||
if ([string]$profile.Target -notin @('Workstation', 'Server')) { throw ('La propriete Target du profil Unattend {0} doit etre Workstation ou Server.' -f $ProfileName) }
|
||||
if ([string]$profile.Template -notmatch '^[A-Za-z0-9_-]+\.xml$') { throw ('Nom de template XML invalide dans le profil {0}.' -f $ProfileName) }
|
||||
if ([string]$profile.Id -ne $ProfileName) { throw ('Unattend profile ID {0} does not match the file name.' -f $ProfileName) }
|
||||
if ([string]$profile.Target -notin @('Workstation', 'Server')) { throw ('The Target property of Unattend profile {0} must be Workstation or Server.' -f $ProfileName) }
|
||||
if ([string]$profile.Template -notmatch '^[A-Za-z0-9_-]+\.xml$') { throw ('Invalid XML template name in profile {0}.' -f $ProfileName) }
|
||||
$templatesRoot = Join-Path (Split-Path -Parent $ProfilesRoot) 'Templates'
|
||||
$templatePath = Join-Path $templatesRoot ([string]$profile.Template)
|
||||
if (-not (Test-Path -LiteralPath $templatePath -PathType Leaf)) { throw "Template XML introuvable pour le profil '$ProfileName' : $templatePath" }
|
||||
if (-not [string]$profile.Name -or [string]::IsNullOrWhiteSpace([string]$profile.Name)) { throw ('Le profil Unattend {0} doit definir un nom affichable.' -f $ProfileName) }
|
||||
if (-not (Test-Path -LiteralPath $templatePath -PathType Leaf)) { throw "XML template not found for profile '$ProfileName': $templatePath" }
|
||||
if (-not [string]$profile.Name -or [string]::IsNullOrWhiteSpace([string]$profile.Name)) { throw ('Unattend profile {0} must define a display name.' -f $ProfileName) }
|
||||
$profile.TemplatePath = $templatePath
|
||||
return $profile
|
||||
}
|
||||
@@ -47,25 +47,25 @@ function Test-DeployCenterUnattendConfiguration {
|
||||
)
|
||||
|
||||
if ($Profile.ComputerName -and $HostName -notmatch '^(?=.*[A-Za-z])[A-Za-z0-9](?:[A-Za-z0-9-]{0,13}[A-Za-z0-9])?$') {
|
||||
throw 'Le nom de machine doit respecter les règles NetBIOS et ne pas dépasser 15 caractères.'
|
||||
throw 'The computer name must follow NetBIOS rules and not exceed 15 characters.'
|
||||
}
|
||||
if ($Profile.LocalAccount) {
|
||||
$accountName = [string]$Configuration.UnattendAdminName
|
||||
$displayName = [string]$Configuration.UnattendAdminDisplayName
|
||||
$groupName = [string]$Configuration.UnattendAdminGroup
|
||||
$passwordBase64 = [string]$Configuration.UnattendAdminPasswordBase64
|
||||
if ($accountName -notmatch '^[^"/\[\]:;|=,+*?<>\\]{1,20}$') { throw 'Le paramètre [Unattend] AdminName doit contenir de 1 à 20 caractères et éviter les caractères interdits par Windows.' }
|
||||
if ([string]::IsNullOrWhiteSpace($displayName)) { throw 'Le paramètre [Unattend] AdminDisplayName ne peut pas être vide.' }
|
||||
if ([string]::IsNullOrWhiteSpace($groupName)) { throw 'Le paramètre [Unattend] AdminGroup ne peut pas être vide.' }
|
||||
if ([string]::IsNullOrWhiteSpace($passwordBase64)) { throw 'Le paramètre [Unattend] AdminPasswordBase64 est requis pour ce profil.' }
|
||||
if ($accountName -notmatch '^[^"/\[\]:;|=,+*?<>\\]{1,20}$') { throw '[Unattend] AdminName must be 1 to 20 characters and must not contain characters prohibited by Windows.' }
|
||||
if ([string]::IsNullOrWhiteSpace($displayName)) { throw '[Unattend] AdminDisplayName cannot be empty.' }
|
||||
if ([string]::IsNullOrWhiteSpace($groupName)) { throw '[Unattend] AdminGroup cannot be empty.' }
|
||||
if ([string]::IsNullOrWhiteSpace($passwordBase64)) { throw 'The [Unattend] AdminPasswordBase64 setting is required for this profile.' }
|
||||
try {
|
||||
$passwordBytes = [Convert]::FromBase64String($passwordBase64)
|
||||
if ($passwordBytes.Length -eq 0 -or ($passwordBytes.Length % 2) -ne 0 -or
|
||||
[string]::IsNullOrEmpty([Text.Encoding]::Unicode.GetString($passwordBytes))) {
|
||||
throw 'Format UTF-16LE Base64 invalide.'
|
||||
throw 'Invalid UTF-16LE Base64 format.'
|
||||
}
|
||||
} catch {
|
||||
throw 'Le paramètre [Unattend] AdminPasswordBase64 doit être un mot de passe UTF-16LE encodé en Base64.'
|
||||
throw '[Unattend] AdminPasswordBase64 must be a UTF-16LE password encoded as Base64.'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ function New-DeployCenterUnattendXml {
|
||||
}
|
||||
if ($Profile.ComputerName) {
|
||||
$node = $document.SelectSingleNode('/u:unattend/u:settings[@pass="specialize"]/u:component[@name="Microsoft-Windows-Shell-Setup"]/u:ComputerName', $namespaces)
|
||||
if ($null -eq $node) { throw ('Le template du profil {0} ne definit pas le noeud ComputerName dans specialize.' -f $Profile.Id) }
|
||||
if ($null -eq $node) { throw ('The template for profile {0} does not define the ComputerName node in specialize.' -f $Profile.Id) }
|
||||
$node.InnerText = $HostName
|
||||
}
|
||||
if ($Profile.LocalAccount) {
|
||||
@@ -111,20 +111,28 @@ function New-DeployCenterUnattendXml {
|
||||
foreach ($name in $values.Keys) {
|
||||
$field = if ($name -eq 'Password') { 'Password/u:Value' } else { $name }
|
||||
$node = $document.SelectSingleNode("/u:unattend/u:settings[@pass='oobeSystem']/u:component[@name='Microsoft-Windows-Shell-Setup']/u:UserAccounts/u:LocalAccounts/u:LocalAccount/u:$field", $namespaces)
|
||||
if ($null -eq $node) { throw ('Le template du profil {0} ne definit pas le champ de compte {1}.' -f $Profile.Id, $name) }
|
||||
if ($null -eq $node) { throw ('The template for profile {0} does not define the account field {1}.' -f $Profile.Id, $name) }
|
||||
$node.InnerText = $values[$name]
|
||||
}
|
||||
}
|
||||
$supportAppUrl = [string]$Configuration.UnattendSupportAppURL
|
||||
$supportUrl = [string]$Configuration.UnattendSupportURL
|
||||
# Compatibility: before SupportURL was added, a web URL could be provided in SupportAppURL.
|
||||
if ($supportAppUrl -match '^https?://') {
|
||||
if ([string]::IsNullOrWhiteSpace($supportUrl)) { $supportUrl = $supportAppUrl }
|
||||
$supportAppUrl = ''
|
||||
}
|
||||
$supportSettings = @(
|
||||
@{ Name = 'SupportProvider'; Value = [string]$Configuration.UnattendSupportProvider },
|
||||
@{ Name = 'SupportAppURL'; Value = [string]$Configuration.UnattendSupportAppURL }
|
||||
@{ Name = 'SupportURL'; Value = $supportUrl },
|
||||
@{ Name = 'SupportAppURL'; Value = $supportAppUrl }
|
||||
)
|
||||
$oemInformationPath = '/u:unattend/u:settings[@pass="oobeSystem"]/u:component[@name="Microsoft-Windows-Shell-Setup"]/u:OEMInformation'
|
||||
foreach ($supportSetting in $supportSettings) {
|
||||
$supportNode = $document.SelectSingleNode(($oemInformationPath + '/u:' + $supportSetting.Name), $namespaces)
|
||||
if ($null -eq $supportNode) {
|
||||
if (-not [string]::IsNullOrWhiteSpace($supportSetting.Value)) {
|
||||
throw ('Le template du profil {0} ne definit pas le noeud {1}.' -f $Profile.Id, $supportSetting.Name)
|
||||
throw ('The template for profile {0} does not define the {1} node.' -f $Profile.Id, $supportSetting.Name)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@@ -140,7 +148,7 @@ function New-DeployCenterUnattendXml {
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($WallpaperPath)) {
|
||||
$shellSetupNode = $document.SelectSingleNode('/u:unattend/u:settings[@pass="oobeSystem"]/u:component[@name="Microsoft-Windows-Shell-Setup"]', $namespaces)
|
||||
if ($null -eq $shellSetupNode) { throw ('Le template du profil {0} ne definit pas le composant Shell-Setup dans oobeSystem.' -f $Profile.Id) }
|
||||
if ($null -eq $shellSetupNode) { throw ('The template for profile {0} does not define the Shell-Setup component in oobeSystem.' -f $Profile.Id) }
|
||||
$themesNode = $shellSetupNode.SelectSingleNode('u:Themes', $namespaces)
|
||||
if ($null -eq $themesNode) {
|
||||
$themesNode = $document.CreateElement('Themes', 'urn:schemas-microsoft-com:unattend')
|
||||
|
||||
Reference in new issue
Block a user