🎯 Objectif
Gagner du temps et éviter les oublis lors de la configuration d’un poste Windows en automatisant l’installation des logiciels, les réglages système, et les optimisations via PowerShell + Winget.
🔧 Pré-requis
Windows 10 (1809+) ou Windows 11
PowerShell v5 ou supérieur
Winget installé (préinstallé sur Windows 11 ou via le Microsoft Store)
📦 Étape 1 : Créer un fichier de liste d’applications Winget
Crée un fichier apps.json
avec la liste des apps à installer :
[
{ "id": "Google.Chrome" },
{ "id": "Microsoft.VisualStudioCode" },
{ "id": "7zip.7zip" },
{ "id": "Notepad++.Notepad++" },
{ "id": "VLC.VLC" }
]
🧠 Étape 2 : Script PowerShell de post installation
Voici un script PowerShell de base :
# post-install.ps1
Write-Host "🚀 Démarrage de la post-installation..."
# Lecture des applications
$appList = Get-Content -Raw -Path ".\apps.json" | ConvertFrom-Json
foreach ($app in $appList) {
Write-Host "📦 Installation de $($app.id)..."
winget install --id $app.id --silent --accept-source-agreements --accept-package-agreements
}
# Exemple de réglage système : afficher les extensions de fichiers
Write-Host "🛠️ Configuration du système..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Value 0
# Exemple : activer le mode sombre
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -PropertyType DWord -Value 0 -Force
Write-Host "✅ Post-installation terminée."
📁 Étape 3 : Lancer le script
Place post-install.ps1 et apps.json dans le même dossier.
Exécute PowerShell en administrateur.
Lance :
Set-ExecutionPolicy RemoteSigned -Scope Process .\post-install.ps1
🧪 Bonus : Personnalisation
Ajoute au script :
Des installations de fonts
Le changement du fond d’écran via SystemParametersInfo
Le mapping réseau ou l’installation d’imprimantes via Add-Printer
🧠 En résumé
PowerShell + Winget = combo gagnant pour gagner un temps fou, et garantir une cohérence entre postes. En quelques minutes, ton environnement est prêt, scripté, et reproductible.