0

我正在尝试从特定键返回注册表值。由于某种原因,我无法获取键的字符串值。我可以得到 DWordValue 没问题。

谁能告诉我为什么字符串值不会返回?

编码:

function getRegistry(){
    Param (
        [string]$hklm = "2147483650",
        [string]$key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run",
        [string]$Value2 = "ConnectionCenter"
    )

    $credential = Get-Credential

    $test | ForEach-Object {
        $wmi = Get-WmiObject -List "StdRegProv" -Namespace root\default -ComputerName "compName" -Credential $credential
        #($wmi.GetStringValue($hklm, $key, $value)).sValue

        $wmi.GetStringValue($hklm, $key, $Value2)
    }
}

getRegistry
4

0 回答 0