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

Simple configuration fails with InvalidOperation error #337

Open
gonzametal opened this issue Sep 6, 2023 · 0 comments
Open

Simple configuration fails with InvalidOperation error #337

gonzametal opened this issue Sep 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gonzametal
Copy link

gonzametal commented Sep 6, 2023

Describe the bug

I wrote a simple configuration using vSphereNode under powershell 7.3.6 (powercli and vspheredsc modules are correctly installed and imported. This is the configuration:

Configuration Test {
    Import-DscResource -ModuleName VMware.vSphereDSC
    vSphereNode 'esxinode.contoso.ar' {
 
        VMHostNtpSettings NTPSettings {
            Name = 'esxinode.contoso.ar'
            NtpServer = @('10.9.0.1')
            NtpServicePolicy = 'on'
        }
    }
}

Then I call this lines

Connect-ViServer -Server 'esxinode.contoso.ar' -Credential $Credential -force
$dscconfig = New-VmwDscConfiguration -Path .\vmware_dsc.ps1 -Verbose
$dscconfig | Start-VmwDscConfiguration -Verbose

This last line gives me the following error:

InvalidOperation: c:\Users\xxx\Documents\PowerShell\Modules\VMware.PSDesiredStateConfiguration\1.0.0.16\Classes\Public\DscConfigurationRunner.ps1:280
Line |
 280 |          $moduleVersion = $DscResource.ModuleName.RequiredVersion.ToSt …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

I do not know how to debug this situation.

Reproduction steps

The configuration is run against a esxi server (not vcenter). It has a trial license (not expired)

Every time I run Start-VMWdscconfiguration i get this error

Expected behavior

NTP settings configured as desired

Additional context

$PSversiontable is

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@gonzametal gonzametal added the bug Something isn't working label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant