internet2107
Goto Top

Powershell: Registry Abfrage und Formatierung

Hallo zusammen.

Ich starte mit folgender Abfrage eine Suche in der Registry, was auch funktioniert.

$keys= Get-ChildItem -path HKLM:\system\ -Recurse -ErrorAction SilentlyContinue | where { $_.Name -match "SQL*" }  
$Items = $Keys | Foreach-Object {Get-ItemProperty $_.PsPath }
ForEach ($Item in $Items) {"{0,-35} {1,-10} " -f $Item.PSChildName, $Item.ImagePath, $Item.WorkingPath}  

Allerdings würde ich das gerne formatiert in einen GridView exportieren, so dass auch mind. 2 Spalten zu sehen sind.
Also, links der Name und rechts der Pfad oder Wert.
Beispiel:
Microsoft-Windows-exFAT-SQM
Microsoft-Windows-Fat-SQM
SQLBrowser "C:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe"
SQLWriter "C:\Program Files\Microsoft SQL Server\90\Shared\sqlwriter.exe"
SqlServerWriter


Leider tue ich mich hiermit etwas schwer.
Jemand eine Idee?

Content-Key: 459050

Url: https://administrator.de/contentid/459050

Printed on: April 26, 2024 at 22:04 o'clock

Mitglied: 139920
Solution 139920 Jun 05, 2019 updated at 07:15:23 (UTC)
Goto Top
Out-Gridview ist dein Freund.
Get-ChildItem -path HKLM:\system -Recurse -ErrorAction SilentlyContinue | where { $_.Name -match "SQL.*" } | %{Get-Itemproperty $_.PsPath | select PsChildName, ImagePath, Workingpath} | Out-Gridview  
Member: internet2107
internet2107 Jun 05, 2019 at 07:22:03 (UTC)
Goto Top
Danke. Dazu noch in einen Einzeiler.. Schönen Tag..