Open Nick-Andreev opened 4 years ago
I don't mind implementing it myself and submitting a pull request. This will require a couple of changes, such as adding a new parameter to Import-DrsRule, changing the function, updating cmdlet help, etc.
If this project is still monitored and you think this addition might be useful, let me know and I can submit the change.
It would be nice to be able to specify the rule not only by name, but also by type, when importing DRS rules from a file.
The way it's implemented right now, if I say have a host group called "host2" and VM to host rule "host2" and I call Import-DrsRule with the following parameters:
Import-DrsRule -Cluster "my-cluster" -Path "drs-rule-export.json" -Name "host2"
Cmdlet will attempt to import both the group and the rule, which is not always what you want. This is the bit of code that checks the name:
The following piece of code will need to be added to also check for type: