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
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
even If I speciffy a cluster I get the same:
Import-DrsRule -Path "C:\Users\xxxx\Documents\Migration\myDrsRule.json" -Cluster Cluster23
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
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
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