-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new-object - cannot find type VNVDTrafficFilterPolicyConfig - verify assembly containing this type is loaded #1
Comments
Greetings, @JulianCeaser- All good in the ISE PS console, but not in a "regular" PowerShell session, you say. So, as we can see from the error message, that custom type ( In efforts to troubleshoot, could you please, in both the ISE PS console and a PowerShell.exe console:
PS C:\> [VNVDTrafficRuleset]
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True False VNVDTrafficRuleSet VNVDBase
PS C:\> [VNVDTrafficRule]
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True False VNVDTrafficRule VNVDBase Are the given sessions able to find these other types, and you get returns like this? |
ISE PS console
Powershell.exe
When calling powershell.exe from command prompt
I am trying to automate the script using task scheduler so being accessible from the command prompt is pretty important to me. Please inform me how I can help you debug. |
Does the powershell script need to have If I do add it and call the script I get this error for
|
Hello- Thanks for the debugging efforts, and for providing the output here. A couple of things:
PS C:\> [VNVDTrafficFilterPolicyConfig]
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True False VNVDTrafficFilterPolicyConfig VNVDBase
But, that does not explain the behavior that you showed in which there are To continue the troubleshooting, let us try launching your script with PowerShell.exe with the "-NoProfile" argument to PowerShell.exe. So, put the necessary C:\>powershell.exe -NoProfile -Command & c:\myscripts\MyGetTrafficFilterStuff.ps1 |
|
Thanks for continuing to troubleshoot this. As for some more details about when/where this is happening:
Matt |
Sure this is what is in test.ps1
I am running this on Windows Server 2012 R2 virtual machine.
|
Thanks for that. I've been trying to reproduce the error, and am failing so far (including on a Win2012R2 VM w/ that same WMF5.0 PowerShell version). Meanwhile, another question for you: is this happening on all of your Win2012R2 machines, or just some, or just this one? |
"using module vNugglets.VDNetworking" instead of "Import-Module vNugglets.VDNetworking" solved it for me, according to Import-Module page on MSFT site:
|
Thanks, @Nick-Andreev -- that's an important and subtle tidbit.
And, if we haven't already enjoyed this help topic, there is the |
You are not alone in this. It seems that classes in PowerShell have been broken for a while and it might be wise to avoid them, until they work out what to do with this long list of issues: PowerShell/PowerShell#6652 |
When I am using this module in my script and calling the script from the commandline I am getting the following error.
This only happens when I am calling the script from the windows console or powershell but does not occur when I am running the script from within powershell ISE.
I have found that the offending line is
Get-VDSwitch -name $VDSwitchName | Get-VDPortGroup -name $VDPortGroup | Get-VNVDTrafficFilterPolicyConfig
Why is this happening and how could I solve this ?
For testing I am running this small test script, after installing vNugglets.VDNetworking.
The text was updated successfully, but these errors were encountered: