I'm not sure why this is failing, but if I Add-Type from a function then for whatever reason my code fails when I need to use the *.dll api.
function Add-References
{
Add-Type -Path "C:\myDllPath.dll"
Add-Type -Path "C:\myDllPath2.dll"
}
I have tried making the function global, the dot operator... Keep in mind this function is contained in a module and is being called by a script. My goal is to just use the function to declare my references rather than copy paste these paths in all of my scripts.