Quantcast
Channel: psappdeploytoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1769

New Post: Specified cast is not valid. (at

$
0
0
Found the issue, underneath these keys was a DWORD value with invalid data. Once I deleted that value it worked as expected. For the OP, I was able to find what keys were having the problem using this script:
$regKeyApplications = @( "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" )
Foreach ($regKey in $regKeyApplications ) {
    If (Test-Path $regKey -ErrorAction SilentlyContinue) {
        $regKeyApplication = Get-ChildItem $regKey -ErrorAction SilentlyContinue | ForEach-Object { 
            Write-Host $_.PsPath
            Get-ItemProperty -LiteralPath $_.PsPath 
            }
    }
}
This script is essentially just the lines of code from "AppDeployToolkitMain.ps1" that were having the original error. I changed it very slightly to output the PSPath to console before Get-ItemProperty was called so that I could match up the errors to the registry key that was having the problem. Hopefully this can help the OP.

Thanks for the great toolkit!

Viewing all articles
Browse latest Browse all 1769

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>