大牛,本人初学powershell,请问如何将注册表中reg-binary格式的值输出显示为ascii呢?


PowerShell交流中心大牛,本人初学powershell,请问如何将注册表中reg-binary格式的值输出显示为ascii呢?
0
jjflypig asked 8 年 ago

大牛,本人初学powershell,请问如何将注册表中reg-binary格式的值输出显示为ascii呢?

codecook 管理员 replied 8 年 ago

请定位个数据源,要输出的格式。

0 Answers
0
Mooser Lee 管理员 answered 8 年 ago
PS> Get-ItemProperty -Path HKCU: -Name testKey


testKey : {80, 83, 116, 105...}
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\
PSParentPath :
PSChildName : HKEY_CURRENT_USER
PSDrive : HKCU
PSProvider : Microsoft.PowerShell.Core\Registry



PS> (Get-ItemProperty -Path HKCU: ).testKey
80
83
116
105
112
115
46
78
69
84
PS C:\Users\libao> [char[]]((Get-ItemProperty -Path HKCU: ).testKey)
P
S
t
i
p
s
.
N
E
T
PS C:\Users\libao> [char[]]((Get-ItemProperty -Path HKCU: ).testKey) -join '
PStips.NET
jjflypig replied 8 年 ago

谢谢您,Mooser Lee,问题顺利解决