Ajout de la partie application des changements sur le disque
Ajout de l'installation de Windows Correction du chargement des images iso. Correction de la définition de la taille de WinRE.
This commit is contained in:
1 parent
1c67cb2630
commit
8d5014b4aa
13 files changed
+2524
-1445
No files matched your search
@@ -0,0 +1,42 @@
|
||||
# DeployCenter - Lecture des préférences utilisateur
|
||||
# Lecture seule : ce module ne modifie jamais DeployCenter.ini.
|
||||
|
||||
function Read-DeployCenterConfig {
|
||||
[CmdletBinding()]
|
||||
param([Parameter(Mandatory=$true)][string]$ConfigPath)
|
||||
|
||||
$config = @{
|
||||
Theme = 'Light'
|
||||
SourcePaths = '%DEPLOY_VOLUME%'
|
||||
VncPassword = ''
|
||||
WinRESizeMB = 1024
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath $ConfigPath -PathType Leaf)) { return $config }
|
||||
|
||||
$section = ''
|
||||
foreach ($line in (Get-Content -LiteralPath $ConfigPath -ErrorAction SilentlyContinue)) {
|
||||
$trimmed = $line.Trim()
|
||||
if (-not $trimmed -or $trimmed.StartsWith(';') -or $trimmed.StartsWith('#')) { continue }
|
||||
if ($trimmed -match '^\[(.+)\]$') { $section = $matches[1].Trim(); continue }
|
||||
if ($trimmed -notmatch '^([^=]+)=(.*)$') { continue }
|
||||
|
||||
$key = $matches[1].Trim()
|
||||
$value = $matches[2].Trim()
|
||||
if ($section -ieq 'General' -and $key -ieq 'Theme' -and $value -match '^[A-Za-z0-9_-]+$') {
|
||||
$config.Theme = $value
|
||||
} elseif ($section -ieq 'Sources' -and $key -ieq 'Paths') {
|
||||
$config.SourcePaths = $value
|
||||
} elseif ($section -ieq 'UltraVNC' -and $key -ieq 'Password') {
|
||||
$config.VncPassword = $value
|
||||
} elseif ($section -ieq 'Partitioning' -and $key -ieq 'WinRESizeMB') {
|
||||
$sizeMB = 0
|
||||
if (-not [int]::TryParse($value, [ref]$sizeMB) -or $sizeMB -lt 990) {
|
||||
throw "Le paramètre [Partitioning] WinRESizeMB doit être un entier supérieur ou égal à 990. Valeur reçue : '$value'."
|
||||
}
|
||||
$config.WinRESizeMB = $sizeMB
|
||||
}
|
||||
}
|
||||
return $config
|
||||
}
|
||||
|
||||
Export-ModuleMember -Function Read-DeployCenterConfig
|
||||
Reference in new issue
Block a user