{"id":3189,"date":"2020-10-13T22:14:44","date_gmt":"2020-10-13T20:14:44","guid":{"rendered":"https:\/\/www.mariotti.de\/?p=3189"},"modified":"2020-10-13T22:14:44","modified_gmt":"2020-10-13T20:14:44","slug":"installierte-software-per-powershell-ermitteln","status":"publish","type":"post","link":"https:\/\/dev.mariotti.de\/?p=3189","title":{"rendered":"Installierte Software per PowerShell ermitteln"},"content":{"rendered":"<p>Installierte Software per PowerShell ermitteln und in eine CSV Datei speichern die mit Excel ge\u00f6ffnet werden kann.<\/p>\n<pre><code class=\"language-powershell\"># Installierte Software aus Registry ermitteln\n[string[]]$RegKeys = 'HKLM:SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall','HKLM:SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall'\n[psobject[]]$Result = @()\nForEach ($RegKey in $RegKeys) {\n      If (Test-Path -LiteralPath $RegKey -ErrorAction SilentlyContinue) {\n             [psobject[]]$UninstallKeyApps = Get-ChildItem -LiteralPath $regKey -ErrorAction SilentlyContinue\n             ForEach ($UninstallKeyApp in $UninstallKeyApps) {\n                   Try {\n                         [psobject]$ResultProps = Get-ItemProperty -LiteralPath $UninstallKeyApp.PSPath -ErrorAction Stop\n                         If ($ResultProps.DisplayName) { [psobject[]]$Result += $ResultProps }\n                   }\n                   Catch{\n                         Write-Host \"Unable to enumerate properties from registry key path [$($UninstallKeyApp.PSPath)].\"\n                         Continue\n                   }\n             }\n      }\n}\n\n# Bildschirmausgabe\n$Result | Format-Table Publisher,DisplayName,DisplayVersion\n\n# CSV Ausgabe\n$Result | Select-Object Publisher,DisplayName,DisplayVersion | Export-Csv -Path \".\\Software.csv\" -Encoding ASCII -Delimiter \";\" -NoTypeInformation \n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Installierte Software per PowerShell ermitteln und in eine CSV Datei speichern die mit Excel ge\u00f6ffnet werden kann.<\/p>\n","protected":false},"author":2,"featured_media":2425,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,36],"tags":[],"class_list":["post-3189","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","category-windows"],"_links":{"self":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts\/3189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3189"}],"version-history":[{"count":0,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/posts\/3189\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=\/wp\/v2\/media\/2425"}],"wp:attachment":[{"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.mariotti.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}