Skip to content

Unable to find type [DRSRule_VMToVMRule] #21

Description

@Backstage24

Hi,
I have a problem with the DRSRule module v2:
Just a simple export script:

$vCenter = "servername"
$Exportpath = "C:\Scripts_chs"
$date = (Get-date -format yyyyMMdd)
Connect-VIServer $vCenter
Export-DrsRule -Path $Exportpath"\DrsRuleInfo_$date.json"

If I run the script .\bla.ps1 rise up the following error:

Unable to find type [DRSRule_VMToVMRule].
At C:\Program Files\WindowsPowerShell\Modules\DRSRule\2.0.0\DRSRule.psm1:271 char:15
+   [OutputType([DRSRule_VMToVMRule],[VMware.Vim.ClusterAffinityRuleSpe ...
+               ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (DRSRule_VMToVMRule:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

If I copy and paste the code in a fresh Powershell session, the export file will generate without a problem.

A little bit strange, isn't it?
Do you have any ideas?

My modules:

ModuleType Version    Name
---------- -------    ----
Script     2.0.0      DRSRule
Manifest   3.1.0.0    Microsoft.PowerShell.Management
Manifest   3.1.0.0    Microsoft.PowerShell.Utility
Script     6.7.0.1... VMware.Vim
Script     11.0.0.... VMware.VimAutomation.Cis.Core
Script     11.0.0.... VMware.VimAutomation.Common
Script     11.0.0.... VMware.VimAutomation.Core
Script     11.0.0.... VMware.VimAutomation.Sdk

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions