Skip to content
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

Cannot validate argument on parameter 'Id'. The argument is null or empty. #326

Open
MaBauMeBad opened this issue May 25, 2021 · 2 comments

Comments

@MaBauMeBad
Copy link

MaBauMeBad commented May 25, 2021

Hi,

i try for the first time the vSphere DSC Module.

Everytime i pipe my VMDSC Configuration Object to Start-VmwDscConfiguration , i receive the following Exception:

PS > $config | Start-VmwDscConfiguration Exception: C:\Program Files\WindowsPowerShell\Modules\VMware.PSDesiredStateConfiguration\1.0.0.16\Classes\Public\DscConfigurationRunner.ps1:203 Line | 203 | throw $dscResourceErrorMessage | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Set method of DatacenterFolder DSC Resource failed with the following error: Cannot validate argument | on parameter 'Id'. The argument is null or empty. Provide an argument that is not null or empty, and | then try the command again.

Is this the Exception mentioned at LIMITATIONS ?

Used Sample DSC:
`Configuration Test {
Import-DscResource -ModuleName 'VMware.vSphereDSC'

vSphereNode 'vCENTERNAME' {
    DatacenterFolder "test" {
        Name = 'test'
        Location = ''
        Ensure = 'Present'
    }

    Datacenter "MyDatacenter" {
        Name = 'MyDatacenter'
        Location = 'test'
        Ensure = 'Present'
        DependsOn = "[DatacenterFolder]test"
    }
}

}`

Setup:
PowerShell Core Version 7.1.3 on Windows 10
PowerCLI Version 12.3
VMware.vSphereDSC Module Version 2.2.0.84
VMware.PSDesiredStateConfiguration Version 1.0.0.17

@jatinpurohit92
Copy link

I believe there is a space in the module path? Can you please confirm the same. If yes, Then its a known issue and you need to move this module to a path which doesn't have space in it.

@MaBauMeBad
Copy link
Author

MaBauMeBad commented May 26, 2021

HI @jatinpurohit92 ,

thanks for your fast response. I tested it. i copied all Default and VMware Modules to one Path and updated the PSModule Variable. But no luck.

->>> output.txt

This happens not only with the DatacenterFolder DSC Ressource, but probably with all of them (tested also with DRSCluster and HACluster).
Tested also with VMware.PSDesiredStateConfiguration Module Version 1.0.0.16 - no changes.

I even reinstalled now PowerShell Core at a different Path to get the Default Modules away from "C:\Program Files".
So the 2 Paths from the $PsModuleVariable ("C:\users\mbauerheim\OneDrive - \Dokumente\PowerShell\Modules" & "C:\Program Files\PowerShell\Modules") are empty and should there for ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants