I'm writing a powershell script on Microsofts WHCK 2.0 API. I'm from perl background so do not know much in powershell or c#.
Well, my code is:
$ObjectModel = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + "microsoft.windows.Kits.Hardware.objectmodel.dll")
$DbConnection = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + "microsoft.windows.Kits.Hardware.objectmodel.dbconnection.dll")
$Submission = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + "microsoft.windows.Kits.Hardware.objectmodel.submission.dll")
And a little bit later.
$List = New-Object "System.Collections.Generic.List``1[Microsoft.Windows.Kits.Hardware.ObjectModel.Target]"
When I run this code, it produces this error:
"New-Object: Cannot find type: [System.Collections.Generic.List`1[Microsoft.Windows.Kits.Hardware.ObjectModel.Target]]: make sure the aseembly containing this type is loaded."
I've verified that the aseemblies are loaded correctly, using CurrentDomain.getAssemblies() method. Also I have verified that the type "Microsoft.Windows.Kits.Hardware.ObjectModel.Target" is present in "Microsoft.Windows.Kits.Hardware.ObjectModel.dll" assembly, as:
$ObjectModel.GetTypes() | % {
if($_.FullName -eq "Microsoft.Windows.Kits.Hardware.ObjectModel.Target")
{
$found=1
}
}
One more thing I would like to mention, "Microsoft.Windows.Kits.Hardware.ObjectModel.Target" this type/class is an abstract class.
I've searched a lot but couldnt get the right way to get rid of this error. Please suggest and help overcoming this error.