Get-ItemProperty : Specified cast is not valid Error When REG_DWORD Value Has Binary Data - by Ben0xA

Status : 


Sign in
to vote
ID 801007 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 9/16/2013 5:05:40 PM
Access Restriction Public


When you use the Get-ItemProperty command on a REG_DWORD value that has binary data instead of Int-32 data, you get the following error message:

Get-ItemProperty : Specified cast is not valid.
At line:1 char:1
+ Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Run\Fail
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ItemProperty], InvalidCastException
    + FullyQualifiedErrorId : System.InvalidCastException,Microsoft.PowerShell.Commands.GetItemPropertyCommand

I tested this in PowerShell 3.0
Screenshots are attached.
Sign in to post a comment.