Liste des logiciels installés sur un système Windows
J’ai conçu un script PowerShell dont l’objet est de lister toutes les applications installées sur la station de travail Windows.
Le script lit le contenu de deux clés de registre :
- HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, pour les logiciels 64 bit
- HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall, pour les logiciels 32 bit
$res=@() $paths='HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall' ForEach($path in $paths) { $keys=Get-ChildItem -path $path ForEach($key in $keys) { $newpath=$path+'\'+$key.PSChildName $name=(Get-ItemProperty -Path $newpath -Name 'DisplayName' -ErrorAction SilentlyContinue ).DisplayName $version=(Get-ItemProperty -Path $newpath -Name 'DisplayVersion' -ErrorAction SilentlyContinue ).DisplayVersion If($name.Length -gt 0) { $res+=[PSCustomObject] @{logiciel=$name;version=$version} } } } $res|sort -unique -property logiciel|out-GridView