Ajout d'un fond d'écran personnalisé si fourni dans DeployCenter.ini

Renommage du profil unattend pour mieux correspondre à ce qu'il fait.
Ajout d'un warning si WinRE n'est pas assez grands au regard des préconisations Microsoft et du redémarrage automatique si l'installation réussi.
This commit is contained in:
benoit committed 2026-10-17 21:28:34 +02:00
1 parent e067721763
commit cb917c97ce
11 files changed
+161 -23

No files matched your search

+46 -1
View File
@@ -76,7 +76,8 @@ function New-DeployCenterUnattendXml {
[Parameter(Mandatory=$true)][System.Collections.IDictionary]$Profile,
[Parameter(Mandatory=$true)][System.Collections.IDictionary]$Configuration,
[Parameter(Mandatory=$true)][string]$HostName,
[Parameter(Mandatory=$true)][string]$Architecture
[Parameter(Mandatory=$true)][string]$Architecture,
[AllowEmptyString()][string]$WallpaperPath = ''
)
Test-DeployCenterUnattendConfiguration -Profile $Profile -Configuration $Configuration -HostName $HostName
@@ -114,6 +115,50 @@ function New-DeployCenterUnattendXml {
$node.InnerText = $values[$name]
}
}
$supportSettings = @(
@{ Name = 'SupportProvider'; Value = [string]$Configuration.UnattendSupportProvider },
@{ Name = 'SupportAppURL'; Value = [string]$Configuration.UnattendSupportAppURL }
)
$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)
}
continue
}
if ([string]::IsNullOrWhiteSpace($supportSetting.Value)) {
[void]$supportNode.ParentNode.RemoveChild($supportNode)
} else {
$supportNode.InnerText = $supportSetting.Value
}
}
$oemInformationNode = $document.SelectSingleNode($oemInformationPath, $namespaces)
if ($null -ne $oemInformationNode -and $oemInformationNode.SelectNodes('u:*', $namespaces).Count -eq 0) {
[void]$oemInformationNode.ParentNode.RemoveChild($oemInformationNode)
}
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) }
$themesNode = $shellSetupNode.SelectSingleNode('u:Themes', $namespaces)
if ($null -eq $themesNode) {
$themesNode = $document.CreateElement('Themes', 'urn:schemas-microsoft-com:unattend')
[void]$shellSetupNode.AppendChild($themesNode)
}
foreach ($themeSetting in @(
@{ Name = 'ThemeName'; Value = 'Blorand' },
@{ Name = 'DesktopBackground'; Value = $WallpaperPath },
@{ Name = 'UWPAppsUseLightTheme'; Value = 'true' }
)) {
$themeNode = $themesNode.SelectSingleNode(('u:' + $themeSetting.Name), $namespaces)
if ($null -eq $themeNode) {
$themeNode = $document.CreateElement($themeSetting.Name, 'urn:schemas-microsoft-com:unattend')
[void]$themesNode.AppendChild($themeNode)
}
$themeNode.InnerText = [string]$themeSetting.Value
}
}
return $document.OuterXml
}