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
@@ -5,17 +5,18 @@ function Get-HardwareInfo {
|
||||
param()
|
||||
|
||||
$info = [ordered]@{
|
||||
Manufacturer = "Inconnu"
|
||||
Model = "Inconnu"
|
||||
SerialNumber = "Inconnu"
|
||||
Firmware = "Inconnu"
|
||||
Manufacturer = "Unknown"
|
||||
Model = "Unknown"
|
||||
SystemSKU = ""
|
||||
SerialNumber = "Unknown"
|
||||
Firmware = "Unknown"
|
||||
Architecture = $env:PROCESSOR_ARCHITECTURE
|
||||
WinPE = $false
|
||||
Disks = @()
|
||||
Errors = @()
|
||||
}
|
||||
|
||||
# Fabricant et modele du PC
|
||||
# PC manufacturer and model
|
||||
try {
|
||||
$computer = Get-CimInstance `
|
||||
-ClassName Win32_ComputerSystem `
|
||||
@@ -28,12 +29,15 @@ function Get-HardwareInfo {
|
||||
if ($computer.Model) {
|
||||
$info.Model = $computer.Model.Trim()
|
||||
}
|
||||
if ($computer.SystemSKUNumber) {
|
||||
$info.SystemSKU = ([string]$computer.SystemSKUNumber).Trim()
|
||||
}
|
||||
}
|
||||
catch {
|
||||
$info.Errors += "Modele du PC : $($_.Exception.Message)"
|
||||
$info.Errors += "PC model: $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
# Numero de serie
|
||||
# Serial number
|
||||
try {
|
||||
$bios = Get-CimInstance `
|
||||
-ClassName Win32_BIOS `
|
||||
@@ -47,7 +51,7 @@ function Get-HardwareInfo {
|
||||
$info.Errors += "Numero de serie : $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
# Detection du firmware
|
||||
# Firmware detection
|
||||
try {
|
||||
$firmwareKey = Get-ItemProperty `
|
||||
-Path "HKLM:\SYSTEM\CurrentControlSet\Control" `
|
||||
@@ -61,20 +65,20 @@ function Get-HardwareInfo {
|
||||
}
|
||||
}
|
||||
catch {
|
||||
$info.Errors += "Mode firmware indisponible"
|
||||
$info.Errors += "Firmware mode unavailable"
|
||||
}
|
||||
|
||||
# Detection de WinPE
|
||||
# WinPE detection
|
||||
$info.WinPE = Test-Path `
|
||||
"HKLM:\SYSTEM\CurrentControlSet\Control\MiniNT"
|
||||
|
||||
# Inventaire des disques physiques
|
||||
# Physical disk inventory
|
||||
try {
|
||||
$disks = @(Get-Disk -ErrorAction Stop)
|
||||
|
||||
foreach ($disk in $disks) {
|
||||
$operationalStatus = @($disk.OperationalStatus | ForEach-Object { [string]$_ } | Where-Object { -not [string]::IsNullOrWhiteSpace($_) })
|
||||
$status = if ($operationalStatus.Count -gt 0) { $operationalStatus -join ', ' } else { 'Inconnu' }
|
||||
$status = if ($operationalStatus.Count -gt 0) { $operationalStatus -join ', ' } else { 'Unknown' }
|
||||
|
||||
$info.Disks += [PSCustomObject]@{
|
||||
Index = [int]$disk.Number
|
||||
@@ -90,10 +94,10 @@ function Get-HardwareInfo {
|
||||
}
|
||||
}
|
||||
catch {
|
||||
$info.Errors += "Inventaire des disques : $($_.Exception.Message)"
|
||||
$info.Errors += "Disk inventory: $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
# Retourner un objet exploitable par les autres modules
|
||||
# Return an object that other modules can use.
|
||||
[PSCustomObject]$info
|
||||
}
|
||||
|
||||
@@ -119,7 +123,7 @@ function Write-DeployInventory {
|
||||
$json = $inventory | ConvertTo-Json -Depth 8
|
||||
Set-Content -LiteralPath $InventoryFile -Value $json -Encoding UTF8
|
||||
|
||||
# Nettoyer les anciens exports séparés après l'écriture de l'inventaire consolidé.
|
||||
# Remove the old separate exports after writing the consolidated inventory.
|
||||
$legacyInventoryFiles = @(
|
||||
(Join-Path $env:TEMP 'HardwareInfo.json'),
|
||||
(Join-Path $InventoryDir 'hardware.json')
|
||||
@@ -129,12 +133,12 @@ function Write-DeployInventory {
|
||||
try {
|
||||
Remove-Item -LiteralPath $legacyFile -Force -ErrorAction Stop
|
||||
} catch {
|
||||
if ($LogAction) { & $LogAction "Impossible de supprimer l'ancien export d'inventaire '$legacyFile' : $($_.Exception.Message)" 'WARNING' }
|
||||
if ($LogAction) { & $LogAction "Unable to remove the previous inventory export '$legacyFile' : $($_.Exception.Message)" 'WARNING' }
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
if ($LogAction) { & $LogAction "Impossible d'écrire l'inventaire temporaire : $($_.Exception.Message)" 'WARNING' }
|
||||
if ($LogAction) { & $LogAction "Unable to write the temporary inventory: $($_.Exception.Message)" 'WARNING' }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user