Powershell - Lister les applications installées

Rédigé par Xpress Aucun commentaire
Classé dans : Powershell Mots clés : Powershell, Lister, Applications, Installées
Ce script PowerShell à pour objet 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:SOFTWAREMicrosoftWindowsCurrentVersionUninstall, pour les logiciels 64 bit HKLM:SOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionUninstall, pour les logiciels 32 bit
$res=@()
$paths='HKLM:SOFTWAREMicrosoftWindowsCurrentVersionUninstall','HKLM:SOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionUninstall'
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
Fil RSS des articles de ce mot clé