title: Powershell Reg.GetValue giving output as "-1" for actual value "ffffffff (hex) / 4294967295 (decimal)"
body: <p>I ran below Powershell code and getting value as Indicated below:</p>
  <pre><code>$regOpen=[microsoft.win32.registrykey]::OpenRemoteBaseKey(‘LocalMachine’,$env:COMPUTERNAME)
  $RegKey= $regOpen.OpenSubKey($reg)
  $Enabled = $RegKey.GetValue('Enabled')
  write-host &quot;Enabled value is : $Enabled&quot;
  </code></pre>
  <p>Output as below:</p>
  <pre><code>Enabled value is : -1
  
  $enabled | Get-Member
  
  TypeName: System.Int32
  </code></pre>
  <p>Value in Registry : ffffffff (hex) / 4294967295 (decimal)</p>
  <p>Another method (Get-ItemProperty) gives correct decimal value 4294967295 as below:</p>
  <pre><code>Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client\' -Name Enabled | select Enabled
  
     Enabled
     -------
  4294967295
  </code></pre>
  <p>What I can do to get correct value 'ffffffff (hex) / 4294967295 (decimal)' from GetValue method?
  Thanks.</p>