1

Closed

PowerShell 3.0 RC

description

Pscx modul WMI failed to load with error "Property 'Get' not available for this object'
Error is in Pscx\Modules\Wmi\Pscx.Wmi.psm1:8 Char:6: if (!$acceleratorsType::Get.ContainsKey($name))
See also : http://connect.microsoft.com/PowerShell/feedback/details/721443/system-management-automation-typeaccelerators-broken-in-v3-ctp2
Closed Oct 17, 2013 at 3:26 PM by r_keith_hill

comments

r_keith_hill wrote Jul 19, 2012 at 5:39 PM

Are you running this on PowerShell 2.0?

r_keith_hill wrote Jul 19, 2012 at 5:43 PM

No, scratch that. The updated PSD1 file won't load into 2.0. Hmm, I've only been testing on Win8 Release Preview and I don't see this error. I fixed this for the latest PowerShell v3 drop a while back. It doesn't look like your Pscx.Wmi.psm1 file is the latest. The relevant code in that file should be:

if ($PSVersionTable.PSVersion.Major -eq 3)
{
$acceleratorsType = [psobject].Assembly.GetType('System.Management.Automation.TypeAccelerators')
}
else
{
$acceleratorsType = [Type]::GetType('System.Management.Automation.TypeAccelerators')
}

In the latest version of this file, line 8 is "{".