La liste des logiciels installés sous Windows en PowerShell
Ce n’est pas toujours simple sous Windows d’avoir la liste complète des logiciels installés sur le système, en dissociant le 32 bit et le 64 bit !
Je vous ai concocté un script en PowerShell vous permettant de disposer de cette liste. Le script génère un fichier logiciels.txt sur votre bureau.
Clear $ErrorActionPreference='SilentlyContinue' $txt=$env:USERPROFILE+'\Desktop\logiciels.txt' $path='HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' $keys=Get-ChildItem -path $path ForEach($key in $Keys) { $tmp=$path+'\'+$key.PSChildName Get-ItemProperty -Path $tmp |Select DisplayName,DisplayVersion|ForEach{ If($_.DisplayName -ne $null) { $value='32 bit : '+$_.DisplayName+' '+$_.DisplayVersion Add-Content -Path $txt -Value $value } } } $path='HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall' $keys=Get-ChildItem -path $path ForEach($key in $Keys) { $tmp=$path+'\'+$key.PSChildName Get-ItemProperty -Path $tmp |Select DisplayName,DisplayVersion|ForEach{ If($_.DisplayName -ne $null) { $value='64 bit : '+$_.DisplayName+' '+$_.DisplayVersion Add-Content -Path $txt -Value $value } } }