I have a registry key that contains multiple string name/data values (they are type REG_SZ). I would like to list the name / data values and sort them by name value. I’d like to do this in powershell. I can get the values with Get-ItemProperty with no problem but I’m not sure how to sort with Sort-Object. As you can see below it’s not sorted.
$item = Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources' | Sort-Object
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data S
ources
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
PSChildName : ODBC Data Sources
PSProvider : Microsoft.PowerShell.Core\Registry
MSDWDATA_DEFAULT_SYBASE4.00 : DataDirect 4.0 Sybase Wire Protocol
Xtreme Sample Database 2003 : Microsoft Access Driver (*.mdb)
NYT_OPS : DataDirect 4.2 Sybase Wire Protocol
NYP_OPS : DataDirect 4.2 Sybase Wire Protocol
NYP_MSPA2 : DataDirect 4.2 Sybase Wire Protocol
NYT_MSPA_A : DataDirect 4.2 Sybase Wire Protocol
1 Answer