VMware Cloud Community
zenivox
Hot Shot
Hot Shot
Jump to solution

DRSRule module: multiple ambiguous overloads found for ".ctor"

Hello, I have exported  successfully all vClusters rules in one line by using the line:

Export-DrsRule -Path c:\myFolder\myDrsRule.json

now I finished  the migration of all hosts  to the new vCenter server and when I run:

Import-DrsRule -Path c:\myFolder\myDrsRule.json

I get  this, surely I´m doing something wrong I hope, it leads me to  the output type but I don´t see what is wrong, the  syntax is correct it  seems:

C:\Users\xxxxx\Documents\WindowsPowerShell\Modules> Import-DrsRule -Path "C:\Users\xxxxx\Documents\Migration\myDrsRule.json"

Multiple ambiguous overloads found for ".ctor" and the argument count: "1".

At C:\Users\xxxxx\Documents\WindowsPowerShell\Modules\DRSRule.psm1:461 char:3

+   [OutputType([DRSRule.VMGroup])]

+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodException

    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

Multiple ambiguous overloads found for ".ctor" and the argument count: "1".

At C:\Users\xxxxx\Documents\WindowsPowerShell\Modules\DRSRule.psm1:536 char:3

+   [OutputType([DRSRule.VMHostGroup])]

+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodException

    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

Multiple ambiguous overloads found for ".ctor" and the argument count: "1".

At C:\Users\xxxxx\Documents\WindowsPowerShell\Modules\DRSRule.psm1:610 char:3

+   [OutputType([DRSRule.VMToVMHostRule])]

+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodException

    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

Multiple ambiguous overloads found for ".ctor" and the argument count: "1".

At C:\Users\xxxxx\Documents\WindowsPowerShell\Modules\DRSRule.psm1:698 char:3

+   [OutputType([DRSRule.VMToVMRule])]

+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodException

    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Looks like the DRSRule.init.ps1 script is not executed, and hence the type(s) is not recognised.

Which version of the DrsRule module are you using?

Do a Get-Module -Name DrsRule -ListAvailable

How did you load the DrsRule module? Auto-load?

Can you try with an explicit Import-Module -Name DrsRule, before trying the import?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
4 Replies
zenivox
Hot Shot
Hot Shot
Jump to solution

even If I speciffy a cluster I get the same:

Import-DrsRule -Path "C:\Users\xxxx\Documents\Migration\myDrsRule.json" -Cluster Cluster23

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Looks like the DRSRule.init.ps1 script is not executed, and hence the type(s) is not recognised.

Which version of the DrsRule module are you using?

Do a Get-Module -Name DrsRule -ListAvailable

How did you load the DrsRule module? Auto-load?

Can you try with an explicit Import-Module -Name DrsRule, before trying the import?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try loading the dev branch fro the repo at GitHub - PowerCLIGoodies/DRSRule at dev

The init script issue should be solved in that branch


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
zenivox
Hot Shot
Hot Shot
Jump to solution

Thanks Luc, appreciated, I went through the  help.txt  file but I could not find anything related to the init script. All good then, thanks! I will use the dev branch as you suggested for the next activities

Reply
0 Kudos