Powershell GetValue is returning gibberish
Why does this:
$RegistryKeys = (Get-ChildItem
HKLM:\SYSTEM\Curren开发者_如何学运维tControlSet\services\VMSMP\Parameters\NicList)
foreach ($subKey in $RegistryKeys) {$subKey.GetValue("FriendlyName")}
Return this (text surrounded by asterisks are gibberish characters):
Corp **j** LitwareInc Perimeter External **䑀** LitwareInc Perimeter Internal **䑀** LitwareInc Perimeter2 External LitwareInc Perimeter2 Internal
It's not gibberish. They're multi-byte Unicode characters, which don't display properly in a cmd window.
See the second answer to this question for a solution.
精彩评论