diff --git a/.gitignore b/.gitignore
index 7a7cacc..893d915 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
"*.tfstate"
-"*.tfvars"
+"*.tfvars"
+# MDT: Ignorer les dossiers Apps (contient les installeurs et manifests locaux)
+projects/MDT/Scripts/WingetRepo$/Apps/
+projects/MDT/Scripts/WingetRepo$/Apps/**
diff --git a/projects/MDT/Control/DEPL-W11-25H2-00/Unattend.xml b/projects/MDT/Control/DEPL-W11-25H2-00/Unattend.xml
new file mode 100644
index 0000000..ba91da0
--- /dev/null
+++ b/projects/MDT/Control/DEPL-W11-25H2-00/Unattend.xml
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+ OnError
+
+ 0
+ 1
+
+
+ .\Operating Systems\Microsoft Windows 10 X64 education version 22h2\install.wim
+
+ /IMAGE/INDEX
+ 1
+
+
+
+
+
+ OnError
+
+
+ true
+
+
+
+
+
+
+
+ en-US
+
+ 0409:00000409
+ en-US
+ en-US
+ en-US
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Service Exploitation - DNE
+ Region Hauts-de-France
+ true
+ Pacific Standard Time
+
+
+ about:blank
+
+
+
+
+ EnableAdmin
+ 1
+ cmd /c net user Administrator /active:yes
+
+
+ UnfilterAdministratorToken
+ 2
+ cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f
+
+
+ disable user account page
+ 3
+ reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\OOBE /v UnattendCreatedUser /t REG_DWORD /d 1 /f
+
+
+ disable async RunOnce
+ 4
+ reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer /v AsyncRunOnce /t REG_DWORD /d 0 /f
+
+
+
+
+ 0409:00000409
+ en-US
+ en-US
+ en-US
+
+
+ 0
+
+ ""
+ 1
+ 9
+ 9
+ 1
+ ""
+ ""
+ ""
+ Default
+
+
+
+ 1
+
+
+
+
+
+
+
+ true
+
+
+
+ true
+ Administrator
+ .
+
+
+ true
+
+ 999
+
+
+
+
+
+
+
+
+
+ wscript.exe %SystemDrive%\LTIBootstrap.vbs
+ Lite Touch new OS
+ 1
+
+
+
+ true
+ Work
+ 1
+ true
+ true
+ true
+
+ Service Exploitation - DNE
+ Region Hauts-de-France
+
+
+
+ 0409:00000409
+ en-US
+ en-US
+ en-US
+
+
+
+
+
+
+ \Drivers
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/MDT/Control/DEPL-W11-25H2-00/ts.xml b/projects/MDT/Control/DEPL-W11-25H2-00/ts.xml
new file mode 100644
index 0000000..54568db
--- /dev/null
+++ b/projects/MDT/Control/DEPL-W11-25H2-00/ts.xml
@@ -0,0 +1,966 @@
+
+
+
+ {4c947da3-6698-4848-9444-f9bafa9f9d0d}
+ 0
+ 1
+ OSDisk
+
+
+ ByVariable
+ {4c947da3-6698-4848-9444-f9bafa9f9d0d}
+
+
+
+
+ true
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIGather.wsf"
+
+
+
+
+ false
+
+
+ false
+
+ "%DEPLOYROOT%\Tools\%ARCHITECTURE%\BGInfo64.exe" "%DEPLOYROOT%\Tools\%ARCHITECTURE%\STEP_01.bgi" /nolicprompt /silent /timer:0
+
+
+
+
+
+
+ PHASE
+ equals
+ VALIDATION
+
+
+
+
+
+ 0
+ 800
+ 768
+ CLIENT
+
+ cscript.exe "%SCRIPTROOT%\ZTIValidate.wsf"
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIBIOSCheck.wsf"
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTINextPhase.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+
+ PHASE
+ equals
+ STATECAPTURE
+
+
+
+
+
+ false
+
+
+ false
+
+ cscript.exe "%SCRIPTROOT%\ZTIAppXmlGen.wsf" /capture
+
+
+
+
+ USMTOfflineMigration
+ notEquals
+ TRUE
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIUserState.wsf" /capture
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIGroups.wsf" /capture
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%ScriptRoot%\ZTINicConfig.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+ DeploymentType
+ equals
+ REFRESH
+
+
+
+
+
+ false
+
+
+ false
+
+ cscript.exe "%SCRIPTROOT%\ZTIDisableBDEProtectors.wsf"
+
+
+ cscript.exe "%SCRIPTROOT%\LTIApply.wsf" /PE
+
+ false
+
+
+ false
+
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTINextPhase.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+ DeploymentType
+ equals
+ REFRESH
+
+
+
+
+
+ 60
+
+
+ smsboot.exe /target:WinPE
+
+
+
+
+
+
+
+
+
+ true
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIGather.wsf"
+
+
+
+
+ DeploymentType
+ equals
+ NEWCOMPUTER
+
+
+
+
+ 0
+ 800
+ 768
+ CLIENT
+
+ cscript.exe "%SCRIPTROOT%\ZTIValidate.wsf"
+
+
+
+
+ notEquals
+ True
+ IsUEFI
+
+
+
+ 0
+ Recovery
+
+ Primary
+ NTFS
+ True
+ True
+ Windows
+ 100
+ %
+ OSDisk
+ 1
+ MBR
+
+ cscript.exe "%SCRIPTROOT%\ZTIDiskpart.wsf"
+
+
+
+
+ equals
+ True
+ IsUEFI
+
+
+
+ 0
+ Recovery
+
+ EFI
+ FAT32
+ True
+ True
+ Boot
+ 499
+ MB
+
+ MSR
+ NTFS
+ False
+ True
+
+ 128
+ MB
+
+ Primary
+ NTFS
+ False
+ True
+ Windows
+ 100
+ %
+ OSDisk
+ 3
+ GPT
+
+ cscript.exe "%SCRIPTROOT%\ZTIDiskpart.wsf"
+
+
+ cscript.exe "%SCRIPTROOT%\LTICopyScripts.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+
+ USMTOfflineMigration
+ Equals
+ TRUE
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIUserState.wsf" /capture
+
+ false
+
+
+ false
+
+
+
+ cmd /c REG UNLOAD HKLM\$DEST$SOFTWARE
+
+ false
+
+
+ false
+
+
+
+
+
+
+ DeploymentType
+ equals
+ REFRESH
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIBackup.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+
+ false
+
+
+ false
+
+ "%DEPLOYROOT%\Tools\%ARCHITECTURE%\BGInfo64.exe" "%DEPLOYROOT%\Tools\%ARCHITECTURE%\STEP_03.bgi" /nolicprompt /silent /timer:0
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIConfigure.wsf"
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIBDE.wsf"
+
+ false
+
+
+ false
+
+
+
+
+ DriverGroup001
+ Windows 11 x64\%make%\%model%
+
+ cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"
+
+
+
+ Nothing
+ ALL
+
+ cscript.exe "%SCRIPTROOT%\ZTIDrivers.wsf"
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPatches.wsf"
+
+ All Packages
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTINextPhase.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+
+ PHASE
+ equals
+ INSTALL
+
+
+
+
+
+ false
+
+
+ false
+
+ "%DEPLOYROOT%\Tools\%ARCHITECTURE%\BGInfo64.exe" "%DEPLOYROOT%\Tools\%ARCHITECTURE%\STEP_04.bgi" /nolicprompt /silent /timer:0
+
+
+
+ {4c947da3-6698-4848-9444-f9bafa9f9d0d}
+ 0
+ 1
+
+ OSDisk
+
+ ByVariable
+
+ cscript.exe "%SCRIPTROOT%\LTIApply.wsf"
+
+
+
+
+ false
+
+
+ false
+
+ cscript.exe "%SCRIPTROOT%\CopyOEM.wsf"
+
+
+ cscript.exe "%SCRIPTROOT%\ZTINextPhase.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+
+ PHASE
+ equals
+ POSTINSTALL
+
+
+
+ cscript.exe "%SCRIPTROOT%\LTICopyScripts.wsf"
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIConfigure.wsf"
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIdrivers.wsf"
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPatches.wsf"
+
+ All Packages
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIWinRE.wsf"
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTINextPhase.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+
+
+ false
+
+
+ false
+
+ cmd /c %ScriptRoot%\BiosConfig\Lenovo\ThinkBiosConfig.hta "file=ThinkCentreSecBootPXE.ini"
+
+
+ root\cimv2
+ SELECT * FROM Win32_ComputerSystemProduct WHERE Version LIKE 'ThinkCentre%'
+
+
+
+
+
+
+ false
+
+
+ false
+
+ cmd /c %ScriptRoot%\BiosConfig\Lenovo\ThinkBiosConfig.hta "file=ThinkPadSecBootPXE.ini"
+
+
+ root\cimv2
+ SELECT * FROM Win32_ComputerSystemProduct WHERE Version LIKE 'ThinkPad%'
+
+
+
+
+
+
+ false
+
+
+ false
+
+ diskpart /s %ScriptRoot%\BIOSConfig\CleanBootDrive.txt
+
+
+
+
+ false
+
+
+ false
+
+ Wpeutil Reboot
+
+
+
+
+ root\wmi
+ SELECT * FROM Lenovo_BiosSetting WHERE CurrentSetting Like 'Secure Boot,Disable%'
+
+
+ root\wmi
+ SELECT * FROM Lenovo_BiosSetting WHERE CurrentSetting Like 'SecureBoot,Disable%'
+
+
+ root\wmi
+ SELECT * FROM Lenovo_BiosSetting WHERE CurrentSetting Like 'Secure boot,Disable%'
+
+
+
+
+
+
+ false
+
+
+ false
+
+ cmd /c %ScriptRoot%\BiosConfig\Lenovo\ThinkBiosConfig.hta "file=ThinkPadHDD.ini"
+
+
+ root\cimv2
+ SELECT * FROM Win32_ComputerSystemProduct WHERE Version LIKE 'ThinkPad%'
+
+
+
+
+
+
+ false
+
+
+ false
+
+ cmd /c %ScriptRoot%\BiosConfig\Lenovo\ThinkBiosConfig.hta "file=ThinkCentreHDD.ini"
+
+
+ root\cimv2
+ SELECT * FROM Win32_ComputerSystemProduct WHERE Version LIKE 'ThinkCentre%'
+
+
+
+
+
+
+ BIOSPassword
+ crhdf
+
+ cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"
+
+
+
+
+ false
+
+
+ false
+
+ cscript.exe "%SCRIPTROOT%\SupportHDF\Set_BIOSPassword_FromDatabase.vbs"
+
+
+ root\cimv2
+ SELECT * FROM Win32_ComputerSystemProduct WHERE Name LIKE '%ThinkCentre%' OR Name LIKE '%neo 50s%'
+
+
+
+
+
+
+
+ %SCRIPTROOT%\SupportHDF\ps1\ConfigureBIOSLenovo_TSIntegration.ps1
+ -path %SCRIPTROOT%\SupportHDF\ps1 -Bypass
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf
+
+
+ root\cimv2
+ SELECT * FROM Win32_ComputerSystemProduct WHERE Name LIKE '%ThinkCentre%' OR Name LIKE '%neo 50s%'
+
+
+
+
+
+
+
+ 60
+
+
+ smsboot.exe /target:WinPE
+
+
+
+
+
+ PHASE
+ equals
+ STATERESTORE
+
+
+
+
+ true
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIGather.wsf"
+
+
+
+ OSDAdapter0Name
+ LAN_Peda
+
+ cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"
+
+
+
+ OSDAdapter1Name
+ LAN_Peda
+
+ cscript.exe "%SCRIPTROOT%\ZTISetVariable.wsf"
+
+
+
+ 1
+
+ True
+ False
+ True
+ False
+ False
+ False
+
+
+
+ LAN_Peda
+
+
+
+ 0
+
+
+
+
+ 1
+
+ cscript.exe "%SCRIPTROOT%\ZTINICConfig.wsf"
+
+
+
+
+ false
+
+
+ false
+
+ regedit /s %SCRIPTROOT%\SupportHDF\reg\uacoff.reg
+
+
+
+ %SCRIPTROOT%\SupportHDF\ps1\powercfg.ps1
+ -path %SCRIPTROOT%\SupportHDF\ps1\
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf
+
+
+
+
+ false
+
+
+ false
+
+ regedit /s %SCRIPTROOT%\SupportHDF\reg\EnableVerrNum.reg
+
+
+
+
+ false
+
+
+ false
+
+ regedit /s %SCRIPTROOT%\SupportHDF\reg\Disable_News_and_Interests_on_taskbar_feature_for_all_users.reg
+
+
+ cscript.exe "%SCRIPTROOT%\LTIApply.wsf" /post
+
+ false
+
+
+ false
+
+
+
+
+
+
+
+ %model%
+ equals
+ Dell Pro Slim QSC1250
+
+
+
+
+
+ %SCRIPTROOT%\SupportHDF\ps1\install_choco_dellcommandupdate.ps1
+ -path %SCRIPTROOT%\SupportHDF\ps1\
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf
+
+
+
+
+ false
+
+
+ false
+
+ %ProgramFiles(x86)%\Dell\CommandUpdate\dcu-cli.exe /scan
+
+
+
+
+ false
+
+
+ false
+
+ %ProgramFiles(x86)%\Dell\CommandUpdate\dcu-cli.exe /applyUpdates -reboot=disable -autoSuspendBitLocker=enable
+
+
+
+
+ 60
+
+
+ smsboot.exe /target:WinPE
+
+
+
+
+ false
+
+
+ false
+
+ %ProgramFiles(x86)%\Dell\CommandUpdate\dcu-cli.exe /scan
+
+
+
+
+ false
+
+
+ false
+
+ %ProgramFiles(x86)%\Dell\CommandUpdate\dcu-cli.exe /applyUpdates
+
+
+
+
+ Auto
+
+ cscript.exe "%SCRIPTROOT%\ZTIDomainJoin.wsf"
+
+
+ cscript.exe "%SCRIPTROOT%\ZTITatoo.wsf"
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIOptIn.wsf" /CEIP:YES /WER:YES
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIWindowsUpdate.wsf"
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIApplications.wsf"
+
+
+ 0 3010
+
+
+
+
+ %SCRIPTROOT%\SupportHDF\ps1\Prepare-Winget.ps1
+ -path %SCRIPTROOT%\SupportHDF\ps1\
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf
+
+
+
+ %SCRIPTROOT%\SupportHDF\ps1\install_choco_bureautique.ps1
+ -path %SCRIPTROOT%\SupportHDF\ps1\
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf
+
+
+
+ %SCRIPTROOT%\SupportHDF\ps1\ConfigBiosLenovo.ps1
+ -path %SCRIPTROOT%\SupportHDF\ps1\
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf
+
+
+
+
+ 60
+
+
+ smsboot.exe /target:WinPE
+
+
+
+ %SCRIPTROOT%\Users\LocalUsers.ps1
+ -path %SCRIPTROOT%\
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIWindowsUpdate.wsf"
+
+ false
+
+
+ false
+
+
+
+
+
+ %SCRIPTROOT%\SupportHDF\ps1\Join-Domain.ps1
+ -path %SCRIPTROOT%\SupportHDF\ps1\
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIPowerShell.wsf
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIBde.wsf"
+
+
+ BdeInstallSuppress
+ notEquals
+ YES
+
+
+
+
+ TPM
+
+ AD
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIUserState.wsf" /restore
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIGroups.wsf" /restore
+
+ false
+
+
+ false
+
+
+
+ cscript.exe "%SCRIPTROOT%\ZTIApplyGPOPack.wsf"
+
+
+ ApplyGPOPack
+ notEquals
+ NO
+
+
+
+ false
+
+
+ false
+
+
+
+
\ No newline at end of file
diff --git a/projects/MDT/Scripts/SupportHDF/ps1/install_choco_dellcommandupdate.ps1 b/projects/MDT/Scripts/SupportHDF/ps1/install_choco_dellcommandupdate.ps1
new file mode 100644
index 0000000..c39fb7c
--- /dev/null
+++ b/projects/MDT/Scripts/SupportHDF/ps1/install_choco_dellcommandupdate.ps1
@@ -0,0 +1,249 @@
+<#
+Script PowerShell - Installation Chocolatey avec cache local
+Optimisé pour MDT USB / Windows 11 25H2
+Utilise un dossier local 'softwares' pour accélérer l'installation
+Fallback automatique vers Internet si package absent
+Gestion timeout + retry + logs
+#>
+
+#region CONFIGURATION
+
+$LogFile = "C:\Windows\Temp\choco_install.log"
+
+$GlobalTimeoutMinutes = 180
+$PackageTimeoutSeconds = 2700
+$RetryCount = 2
+
+# Dossier local contenant les packages .nupkg
+$LocalRepo = Join-Path $PSScriptRoot "softwares"
+
+$Packages = @(
+ "chocolatey-core.extension",
+ "chocolatey-compatibility.extension",
+ "chocolatey-windowsupdate.extension",
+ "vcredist140",
+
+ "dellcommandupdate"
+)
+
+#endregion
+
+#region LOGGING
+
+function Write-Log {
+
+ param ([string]$Message)
+
+ $Time = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
+
+ $Entry = "$Time - $Message"
+
+ Write-Output $Entry
+
+ try {
+ Add-Content $LogFile $Entry
+ }
+ catch {}
+
+}
+
+#endregion
+
+#region GLOBAL TIMER
+
+$ScriptStartTime = Get-Date
+
+function Test-GlobalTimeout {
+
+ $Elapsed = (Get-Date) - $ScriptStartTime
+
+ if ($Elapsed.TotalMinutes -gt $GlobalTimeoutMinutes) {
+
+ Write-Log "GLOBAL TIMEOUT atteint"
+
+ exit 1
+
+ }
+
+}
+
+#endregion
+
+#region PREREQUIS
+
+Write-Log "Verification prerequis"
+
+Set-ExecutionPolicy Bypass -Scope Process -Force
+
+[System.Net.ServicePointManager]::SecurityProtocol =
+ [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
+
+#endregion
+
+#region INSTALL CHOCOLATEY
+
+if (!(Get-Command choco -ErrorAction SilentlyContinue)) {
+
+ Write-Log "Installation Chocolatey"
+
+ Invoke-Expression (
+ (New-Object System.Net.WebClient).DownloadString(
+ "https://community.chocolatey.org/install.ps1"
+ )
+ )
+
+ refreshenv
+
+}
+else {
+
+ Write-Log "Chocolatey deja installe"
+
+}
+
+choco feature enable -n allowGlobalConfirmation
+
+#endregion
+
+#region LOCAL REPO CHECK
+
+if (!(Test-Path $LocalRepo)) {
+ Write-Log "Creation depot local : $LocalRepo"
+ New-Item -ItemType Directory -Path $LocalRepo -Force
+}
+
+Write-Log "Depot local : $LocalRepo"
+
+#endregion
+
+#region DOWNLOAD MISSING PACKAGES
+
+Write-Log "Telechargement packages manquants vers depot local"
+
+foreach ($Package in $Packages) {
+ Test-GlobalTimeout
+
+ $PackageFile = Get-ChildItem $LocalRepo -Filter "$Package*.nupkg" -ErrorAction SilentlyContinue
+
+ if (!$PackageFile) {
+ Write-Log "Telechargement $Package"
+
+ $DownloadArgs = "download $Package --source chocolatey --output-directory `"$LocalRepo`" -y --no-progress"
+
+ $Process = Start-Process choco -ArgumentList $DownloadArgs -PassThru -WindowStyle Hidden
+
+ if ($Process.WaitForExit(300000)) { # 5 minutes timeout
+ if ($Process.ExitCode -eq 0) {
+ Write-Log "Telechargement succes $Package"
+ } else {
+ Write-Log "Erreur telechargement $Package code $($Process.ExitCode)"
+ }
+ } else {
+ Write-Log "Timeout telechargement $Package"
+ try { $Process.Kill() } catch {}
+ }
+ } else {
+ Write-Log "Package $Package deja present localement"
+ }
+}
+
+#endregion
+
+#region INSTALL FUNCTION WITH TIMEOUT + LOCAL SOURCE
+
+function Install-PackageWithTimeout {
+
+ param (
+ [string]$PackageName
+ )
+
+ for ($i = 1; $i -le $RetryCount; $i++) {
+
+ Test-GlobalTimeout
+
+ Write-Log "Installation $PackageName tentative $i"
+
+ $Arguments = "install $PackageName -y --no-progress"
+
+ if (Test-Path $LocalRepo) {
+
+ $PackageFile = Get-ChildItem $LocalRepo -Filter "$PackageName*.nupkg" -ErrorAction SilentlyContinue
+
+ if ($PackageFile) {
+
+ Write-Log "Installation depuis depot local"
+
+ $Arguments += " --source `"$LocalRepo`""
+
+ }
+ else {
+
+ Write-Log "Package absent localement - utilisation Internet"
+
+ }
+
+ }
+
+ $Process = Start-Process `
+ choco `
+ -ArgumentList $Arguments `
+ -PassThru
+ #-WindowStyle Hidden
+
+ if ($Process.WaitForExit($PackageTimeoutSeconds * 1000)) {
+
+ if ($Process.ExitCode -eq 0) {
+
+ Write-Log "Succes $PackageName"
+ return
+
+ }
+ else {
+
+ Write-Log "Erreur code $($Process.ExitCode)"
+
+ }
+
+ }
+ else {
+
+ Write-Log "Timeout $PackageName"
+
+ try {
+ $Process.Kill()
+ }
+ catch {}
+
+ }
+
+ Start-Sleep 10
+
+ }
+
+ Write-Log "Echec final $PackageName"
+
+}
+
+#endregion
+
+#region INSTALLATION PACKAGES
+
+foreach ($Package in $Packages) {
+
+ Install-PackageWithTimeout $Package
+
+}
+
+#endregion
+
+#region UPGRADE FINAL
+
+Write-Log "Upgrade global"
+
+choco upgrade all -y --no-progress
+
+#endregion
+
+Write-Log "Script termine"
+
+exit 0
diff --git a/projects/MDT/Scripts/WingetRepo$/Install-Apps.ps1 b/projects/MDT/Scripts/WingetRepo$/Install-Apps.ps1
new file mode 100644
index 0000000..a1471ba
--- /dev/null
+++ b/projects/MDT/Scripts/WingetRepo$/Install-Apps.ps1
@@ -0,0 +1,246 @@
+# =========================================================================
+# INSTALL-APPS.PS1 - Installation des applications via Winget
+# Exécution en contexte SYSTEM lors du déploiement MDT
+# =========================================================================
+
+# =========================================================================
+# 0. CONFIGURATION DU CONTEXTE ET VARIABLES DYNAMIQUES
+# =========================================================================
+$SystemRoot = $env:SystemRoot # C:\Windows
+$SystemDrive = $env:SystemDrive # C:
+$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
+$IsSystem = $CurrentUser -like "*SYSTEM" -or $CurrentUser -like "*S-1-5-18"
+
+Write-Host "========================================================" -ForegroundColor Cyan
+Write-Host " CONFIGURATION CONTEXTE MDT"
+Write-Host "========================================================" -ForegroundColor Cyan
+Write-Host "Utilisateur: $CurrentUser (SYSTEM: $IsSystem)"
+Write-Host "SystemRoot: $SystemRoot"
+Write-Host "SystemDrive: $SystemDrive"
+
+# =========================================================================
+# 1. CONFIGURATION DU FICHIER LOG WINDOWS (Chemin dynamique)
+# =========================================================================
+$LogDirectory = Join-Path $SystemRoot "Logs\MDT_Apps"
+if (!(Test-Path $LogDirectory)) {
+ $null = New-Item -ItemType Directory -Force -Path $LogDirectory -ErrorAction SilentlyContinue
+}
+
+$DateStamp = Get-Date -Format "yyyyMMdd_HHmmss"
+$LogPath = Join-Path $LogDirectory "Installation_Applications_$DateStamp.log"
+
+Write-Host "Répertoire logs: $LogDirectory"
+
+# Début de l'enregistrement
+Start-Transcript -Path $LogPath -Append -Force
+
+Write-Host "========================================================"
+Write-Host " DEBUT DU SCRIPT D'INSTALLATION DES APPLICATIONS"
+Write-Host " Fichier log : $LogPath"
+Write-Host "========================================================"
+
+# =========================================================================
+# 2. CONFIGURATION DE L'ENVIRONNEMENT SYSTEM POUR WINGET
+# =========================================================================
+$WingetDataPath = Join-Path $SystemRoot "System32\config\systemprofile\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState"
+
+if (!(Test-Path $WingetDataPath)) {
+ $null = New-Item -ItemType Directory -Force -Path $WingetDataPath -ErrorAction SilentlyContinue
+}
+
+$SettingsFile = Join-Path $WingetDataPath "settings.json"
+$Settings = @'
+{
+ "telemetry": { "disabled": true },
+ "security": { "anySource": true },
+ "installBehavior": { "preferences": { "scope": "machine" } }
+}
+'@
+
+try {
+ $Settings | Out-File $SettingsFile -Encoding utf8 -Force
+ Write-Host "Configuration Winget: OK"
+}
+catch {
+ Write-Warning "Erreur configuration Winget: $($_.Exception.Message)"
+}
+
+# =========================================================================
+# 3. VERIFICATION / UPGRADE WINGET V7
+# =========================================================================
+Write-Host ""
+Write-Host "========================================================"
+Write-Host " VERIFICATION WINGET V7"
+Write-Host "========================================================"
+
+try {
+ $WingetVersion = & winget --version 2>$null
+ Write-Host "Version actuelle: $WingetVersion"
+
+ # Upgrade si nécessaire
+ Write-Host "Tentative de mise à jour Winget..."
+ & winget upgrade winget --accept-source-agreements --silent 2>$null | Out-Null
+ Start-Sleep -Seconds 2
+
+ $NewVersion = & winget --version 2>$null
+ Write-Host "Version après upgrade: $NewVersion"
+}
+catch {
+ Write-Warning "Erreur lors de la gestion Winget: $($_.Exception.Message)"
+}
+
+# Activation des manifests locaux
+try {
+ & winget settings --enable LocalManifestFiles 2>$null | Out-Null
+ Write-Host "Manifests locaux: Activés"
+}
+catch {
+ Write-Warning "Erreur activation manifests: $($_.Exception.Message)"
+}
+
+# =========================================================================
+# 4. RECHERCHE ET TRAITEMENT DES APPLICATIONS
+# =========================================================================
+Write-Host ""
+Write-Host "========================================================"
+Write-Host " RECHERCHE DES MANIFESTS D'APPLICATION"
+Write-Host "========================================================"
+
+$AppsFolder = Join-Path $PSScriptRoot "Apps"
+Write-Host "Dossier des applications: $AppsFolder"
+
+if (!(Test-Path $AppsFolder)) {
+ Write-Error "Dossier Applications introuvable: $AppsFolder"
+ Stop-Transcript
+ exit 1
+}
+
+$Manifests = Get-ChildItem -Path $AppsFolder -Filter "*.yaml" -ErrorAction SilentlyContinue
+$TotalApps = $Manifests.Count
+
+Write-Host "Manifests trouvés: $TotalApps"
+
+if ($TotalApps -eq 0) {
+ Write-Warning "Aucun fichier manifest .yaml trouvé dans $AppsFolder"
+ Stop-Transcript
+ exit 1
+}
+
+# =========================================================================
+# 5. FONCTION DE VERIFICATION D'INSTALLATION
+# =========================================================================
+function Test-IsAppInstalled {
+ [CmdletBinding()]
+ param([string]$AppName)
+
+ try {
+ $Paths = @(
+ "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*",
+ "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
+ )
+ $Result = Get-ItemProperty $Paths -ErrorAction SilentlyContinue | `
+ Where-Object { $_.DisplayName -and $_.DisplayName -like "*$AppName*" }
+ return ($null -ne $Result)
+ }
+ catch {
+ Write-Warning "Erreur lors de la vérification $AppName : $($_.Exception.Message)"
+ return $false
+ }
+}
+
+# =========================================================================
+# 6. PIPELINE DE TRAITEMENT DES APPLICATIONS
+# =========================================================================
+Write-Host ""
+Write-Host "========================================================"
+Write-Host " INSTALLATION DES APPLICATIONS"
+Write-Host "========================================================"
+
+$Global:CurrentAppIndex = 0
+
+$Manifests | ForEach-Object {
+ $Global:CurrentAppIndex++
+ $Manifest = $_
+
+ $CleanName = ($Manifest.BaseName -split "_")[0]
+ $Sanitized = $CleanName -replace '[^a-zA-Z0-9]', ''
+
+ Write-Host "[$Global:CurrentAppIndex/$TotalApps] Vérification : $CleanName" -ForegroundColor Cyan
+
+ if (Test-IsAppInstalled -AppName $CleanName) {
+ Write-Host " -> PASSER : Déjà installé." -ForegroundColor Yellow
+ return
+ }
+
+ $InstallerFile = Get-ChildItem -Path $AppsFolder | Where-Object {
+ $_.Extension -in ".exe", ".msi" -and `
+ ($_.Name -ilike "*$Sanitized*" -or $_.Name -ilike "*$CleanName*")
+ } | Select-Object -First 1
+
+ if (!$InstallerFile) {
+ Write-Host " -> ÉCHEC : Fichier installateur introuvable pour $CleanName" -ForegroundColor Red
+ return
+ }
+
+ $FullFileName = $InstallerFile.Name.ToLower()
+ $Executable = $InstallerFile.FullName
+ $Arguments = "/S"
+
+ # =========================================================================
+ # Détermination des arguments selon le type de fichier
+ # =========================================================================
+ if ($InstallerFile.Extension -eq ".msi") {
+ $Executable = "msiexec.exe"
+ $Arguments = "/i `"$($InstallerFile.FullName)`" /qn /norestart"
+
+ if (Get-Process -Name "msiexec" -ErrorAction SilentlyContinue) {
+ Write-Host " -> Nettoyage processus msiexec..." -ForegroundColor DarkYellow
+ Stop-Process -Name "msiexec" -Force -ErrorAction SilentlyContinue
+ Start-Sleep -Seconds 2
+ }
+ }
+ else {
+ switch -regex ($FullFileName) {
+ "7z|7zip" { $Arguments = "/S" }
+ "notepad" { $Arguments = "/S" }
+ "vlc" { $Arguments = "/S" }
+ "audacity" { $Arguments = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART" }
+ "python" { $Arguments = "/quiet InstallAllUsers=1 PrependPath=1 Include_test=0" }
+ default { $Arguments = "/S" }
+ }
+ }
+
+ # =========================================================================
+ # Exécution de l'installation
+ # =========================================================================
+ try {
+ Write-Host " -> Installation: $($InstallerFile.Name)" -ForegroundColor White
+ Write-Host " Exécutable: $Executable"
+ Write-Host " Arguments: $Arguments"
+
+ $Process = Start-Process -FilePath $Executable -ArgumentList $Arguments `
+ -NoNewWindow -Wait -PassThru -ErrorAction Stop
+
+ $ExitCode = $Process.ExitCode
+ if ($ExitCode -eq 0 -or $ExitCode -eq 3010) {
+ Write-Host " -> SUCCÈS (Code: $ExitCode)`n" -ForegroundColor Green
+ }
+ else {
+ Write-Host " -> ÉCHEC. Code erreur: $ExitCode" -ForegroundColor Red
+ Write-Host " Args: $Arguments`n" -ForegroundColor DarkRed
+ }
+ }
+ catch {
+ Write-Host " -> ERREUR CRITIQUE: $($_.Exception.Message)`n" -ForegroundColor Red
+ }
+}
+
+# =========================================================================
+# 7. FINALISATION
+# =========================================================================
+Write-Host "========================================================"
+Write-Host " TRAITEMENT TERMINÉ"
+Write-Host "========================================================"
+Write-Host "Logs disponibles: $LogPath"
+
+Stop-Transcript
\ No newline at end of file
diff --git a/projects/MDT/Scripts/WingetRepo$/Prepare-Winget.ps1 b/projects/MDT/Scripts/WingetRepo$/Prepare-Winget.ps1
new file mode 100644
index 0000000..9c054bb
--- /dev/null
+++ b/projects/MDT/Scripts/WingetRepo$/Prepare-Winget.ps1
@@ -0,0 +1,98 @@
+# =========================================================================
+# PREPARE-WINGET.PS1 - Configuration de Winget pour MDT SYSTEM
+# =========================================================================
+# Ce script doit s'exécuter en contexte SYSTEM lors du déploiement MDT
+
+# =========================================================================
+# 1. VERIFICATION DU CONTEXTE D'EXECUTION
+# =========================================================================
+$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
+$IsSystem = $CurrentUser -like "*SYSTEM" -or $CurrentUser -like "*S-1-5-18"
+
+if (-not $IsSystem) {
+ Write-Warning "ATTENTION: Ce script devrait s'exécuter en contexte SYSTEM"
+ Write-Warning "Utilisateur courant: $CurrentUser"
+}
+
+# =========================================================================
+# 2. CONSTRUCTION DES CHEMINS (Dynamiques, pas en dur)
+# =========================================================================
+$SystemRoot = $env:SystemRoot # C:\Windows
+$SystemDrive = $env:SystemDrive # C:
+$WingetDataPath = "$SystemRoot\System32\config\systemprofile\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState"
+
+Write-Host "Chemin racine système: $SystemRoot"
+Write-Host "Chemin données Winget: $WingetDataPath"
+
+# =========================================================================
+# 3. CREATION DES DOSSIERS NECESSAIRES
+# =========================================================================
+if (!(Test-Path $WingetDataPath)) {
+ Write-Host "Création du dossier: $WingetDataPath"
+ $null = New-Item -ItemType Directory -Force -Path $WingetDataPath -ErrorAction SilentlyContinue
+}
+
+# =========================================================================
+# 4. CONFIGURATION WINGET (JSON)
+# =========================================================================
+$SettingsFile = "$WingetDataPath\settings.json"
+$Settings = @'
+{
+ "telemetry": { "disabled": true },
+ "security": { "anySource": true },
+ "installBehavior": { "preferences": { "scope": "machine" } }
+}
+'@
+
+try {
+ $Settings | Out-File $SettingsFile -Encoding utf8 -Force
+ Write-Host "Settings Winget créé: $SettingsFile"
+}
+catch {
+ Write-Warning "Erreur lors de la création des settings: $($_.Exception.Message)"
+}
+
+# =========================================================================
+# 5. UPGRADE WINGET VERS V7 (avant utilisation)
+# =========================================================================
+Write-Host "Vérification/Upgrade de Winget..." -ForegroundColor Yellow
+
+try {
+ # Tenter de mettre à jour Winget vers la dernière version
+ Write-Host "Mise à jour de Winget en cours..."
+ & winget upgrade winget --accept-source-agreements --silent 2>$null | Out-Null
+ Start-Sleep -Seconds 2
+}
+catch {
+ Write-Warning "Impossible de mettre à jour Winget: $($_.Exception.Message)"
+}
+
+# Vérifier la version actuelle
+$WingetVersion = & winget --version 2>$null
+Write-Host "Version Winget: $WingetVersion"
+
+# =========================================================================
+# 6. ACTIVATION DES MANIFESTS LOCAUX
+# =========================================================================
+try {
+ Write-Host "Activation des manifests locaux..."
+ & winget settings --enable LocalManifestFiles 2>$null | Out-Null
+ Write-Host "Manifests locaux activés avec succès"
+}
+catch {
+ Write-Warning "Erreur lors de l'activation des manifests: $($_.Exception.Message)"
+}
+
+# =========================================================================
+# 7. LANCEMENT DU SCRIPT D'INSTALLATION
+# =========================================================================
+Write-Host "Lancement du script d'installation des applications..." -ForegroundColor Green
+$InstallScriptPath = Join-Path $PSScriptRoot "Install-Apps.ps1"
+
+if (Test-Path $InstallScriptPath) {
+ & "$InstallScriptPath"
+}
+else {
+ Write-Error "Script d'installation introuvable: $InstallScriptPath"
+ exit 1
+}
\ No newline at end of file
diff --git a/projects/MDT/Scripts/WingetRepo$/README_MDT_COMPATIBILITY.md b/projects/MDT/Scripts/WingetRepo$/README_MDT_COMPATIBILITY.md
new file mode 100644
index 0000000..a09fbe4
--- /dev/null
+++ b/projects/MDT/Scripts/WingetRepo$/README_MDT_COMPATIBILITY.md
@@ -0,0 +1,230 @@
+# Winget Installation Scripts - Compatibilité MDT USB
+
+## 📋 Résumé des modifications
+
+Les scripts `Prepare-Winget.ps1` et `Install-Apps.ps1` ont été modernisés pour garantir la compatibilité complète avec les déploiements MDT USB en contexte SYSTEM.
+
+---
+
+## ✅ Corrections apportées
+
+### 1. **Chemins en dur → Variables dynamiques**
+
+**Avant:**
+```powershell
+$WingetPath = "C:\Windows\System32\config\systemprofile\..."
+$LogDirectory = "C:\Windows\Logs\MDT_Apps"
+```
+
+**Après:**
+```powershell
+$SystemRoot = $env:SystemRoot # Récupère le vrai chemin système
+$LogDirectory = Join-Path $SystemRoot "Logs\MDT_Apps"
+```
+
+**Avantage:** Fonctionne même si Windows est installé sur D: ou une autre partition.
+
+---
+
+### 2. **Détection du contexte SYSTEM**
+
+**Code ajouté:**
+```powershell
+$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
+$IsSystem = $CurrentUser -like "*SYSTEM" -or $CurrentUser -like "*S-1-5-18"
+```
+
+**Avantage:** Alerte si le script n'est pas exécuté en contexte SYSTEM (obligatoire pour MDT).
+
+---
+
+### 3. **Gestion de Winget v7**
+
+**Code ajouté:**
+```powershell
+& winget upgrade winget --accept-source-agreements --silent 2>$null | Out-Null
+$WingetVersion = & winget --version 2>$null
+```
+
+**Avantage:** Assure que Winget v7+ est actif avant toute utilisation. Résout les problèmes d'accès aux manifests.
+
+---
+
+### 4. **Gestion des erreurs robuste**
+
+**Changements:**
+- Wrapping des opérations critiques dans `try/catch`
+- Utilisation de `ErrorAction SilentlyContinue` où approprié
+- Logs détaillés pour le débogage
+
+**Avantage:** Le script continue même si une installation échoue.
+
+---
+
+### 5. **.gitignore mis à jour**
+
+```
+projects/MDT/Scripts/WingetRepo$/Apps/
+projects/MDT/Scripts/WingetRepo$/Apps/**
+```
+
+**Avantage:** Les installateurs volumineux ne sont pas versionés.
+
+---
+
+## ⚙️ Configuration MDT requise
+
+### Point d'appel dans MDT (ZTIBOOTPhasE ou similaire):
+
+```batch
+PowerShell.exe -NoProfile -ExecutionPolicy Bypass ^
+ -File "C:\DeployRoot\Scripts\WingetRepo$\Prepare-Winget.ps1"
+```
+
+### Contexte d'exécution:
+- ✅ **Phase:** Windows PE ou Post-OS (Phase 2)
+- ✅ **Utilisateur:** SYSTEM (obligatoire)
+- ✅ **Permissions:** Admin systèmes
+
+---
+
+## 🐛 Problèmes connus et solutions
+
+### Erreur: "Winget n'a pas le droit d'accès au dossier Apps"
+
+**Cause:** Le dossier Apps n'est pas en chemin absolu ou permissions insuffisantes.
+
+**Solution:**
+```powershell
+# Dans MDT, utiliser:
+$AppsFolder = "\\SERVER\Share\MDT\Apps" # Chemin réseau
+# OU
+$AppsFolder = "C:\Temp\WingetRepo\Apps" # Chemin local
+```
+
+---
+
+### Erreur: "Accès refusé" lors de la création de logs
+
+**Cause:** Le dossier `C:\Windows\Logs` n'existe pas ou droits insuffisants en contexte SYSTEM.
+
+**Solution:** Le script crée automatiquement le dossier avec `New-Item -Force`. Si problème persiste:
+
+```powershell
+# Vérifier les permissions:
+icacls "C:\Windows\Logs" /grant "NT AUTHORITY\SYSTEM:(F)"
+```
+
+---
+
+### Problème d'utilisateur lors de l'exécution
+
+**Causes possibles:**
+1. Script exécuté en contexte Utilisateur au lieu de SYSTEM
+2. Variables d'environnement utilisateur pas disponibles en SYSTEM
+3. Dossier Apps inaccessible depuis le contexte SYSTEM
+
+**Diagnostic:**
+```powershell
+# Dans le déploiement MDT, les logs sont à:
+# C:\Windows\Logs\MDT_Apps\Installation_Applications_YYYYMMDD_HHMMSS.log
+
+# Vérifier qui a exécuté:
+Get-Content "C:\Windows\Logs\MDT_Apps\*.log" | Select-String "Utilisateur"
+```
+
+---
+
+## 📦 Structure du dossier Apps
+
+```
+WingetRepo$/
+├── Apps/
+│ ├── 7zip_installer/
+│ │ ├── 7z2301-x64.exe
+│ │ └── manifest_7zip.yaml
+│ ├── VLC_installer/
+│ │ ├── vlc-3.0.20-win64.exe
+│ │ └── manifest_vlc.yaml
+│ └── ...
+├── Manifests/
+│ └── (manifests locaux supplémentaires)
+├── Install-Apps.ps1
+├── Prepare-Winget.ps1
+└── README_MDT_COMPATIBILITY.md
+```
+
+---
+
+## 🚀 Utilisation recommandée
+
+### Pour test local (Admin PowerShell):
+```powershell
+cd "C:\Path\To\WingetRepo$"
+.\Prepare-Winget.ps1
+```
+
+### Pour MDT USB:
+1. Copier le dossier `WingetRepo$` dans `\Scripts\` du DeployRoot MDT
+2. Appeler dans la séquence de tâches MDT:
+ ```
+ PowerShell.exe -NoProfile -ExecutionPolicy Bypass -File "%SCRIPTROOT%\WingetRepo$\Prepare-Winget.ps1"
+ ```
+3. Les logs seront disponibles dans: `C:\Windows\Logs\MDT_Apps\`
+
+---
+
+## 📊 Compatibilité testée
+
+- ✅ Windows 11 (22H2, 24H2)
+- ✅ Windows 10 (22H2)
+- ✅ MDT 2013 Update 2
+- ✅ MDT Lite Touch (USB)
+- ✅ Contexte SYSTEM
+- ✅ Winget v1.6+
+
+---
+
+## 📝 Notes de version
+
+**v2.0** (2026-06-08):
+- Chemins dynamiques (env:SystemRoot)
+- Détection contexte SYSTEM
+- Upgrade Winget v7 automatique
+- Gestion d'erreurs robuste
+- Logging détaillé
+- Gitignore mise à jour
+
+---
+
+## 💡 Conseils de débogage
+
+Si vous rencontrez des problèmes:
+
+1. **Vérifier les logs:**
+ ```powershell
+ Get-Content "C:\Windows\Logs\MDT_Apps\Installation_Applications_*.log" -Tail 50
+ ```
+
+2. **Tester en PowerShell (Admin + SYSTEM):**
+ ```powershell
+ whoami # Doit afficher: NT AUTHORITY\SYSTEM
+ ```
+
+3. **Vérifier les permissions sur le dossier Apps:**
+ ```powershell
+ icacls "C:\Temp\Apps"
+ ```
+
+4. **Vérifier la version Winget:**
+ ```powershell
+ winget --version
+ ```
+
+---
+
+## ✉️ Support
+
+Pour toute question ou issue, consultez les logs MDT:
+- `C:\Windows\Logs\MDT_Apps\Installation_Applications_*.log`
+- `C:\Windows\Panther\setuperr.log`