-
Notifications
You must be signed in to change notification settings - Fork 50
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
Update NanoComputeExample.ps1 #259
base: dev
Are you sure you want to change the base?
Conversation
When running this configuration, this error occurs: At line:27 char:17 + PrefixLength = $node.PrefixLength; + ~~~~~~~~~~~~ The member 'PrefixLength' is not valid. Valid members are 'AddressFamily', 'DependsOn', 'InterfaceAlias', 'IPAddress', 'PsDscRunAsCredential'. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : InvalidInstanceProperty #'ing out line 27 enables it to run without error.
Which version of xNetworking are you using? PrefixLength was around in 3.x and 4.x, 5.x added new functionality to specify the IP as CIDR notation and allow setting multiple at a time, as part of this it removed the PrefixLength property. Maybe we need to specify the version of the module to be used in this example? |
Hi @Panzerbjrn - this sounds like you don't have the correct version of the xNetworking DSC resource installed on the machine that you're trying to compile the configuration on. There was a breaking change to the schema in the xNetworking 3.0.0.0 release. The [1] C:\..\Dropbox\PowerShell> Get-DscResource -Name xIPAddress -Module xNetworking
ImplementedAs Name ModuleName Version Properties
------------- ---- ---------- ------- ----------
PowerShell xIPAddress xNetworking 3.2.0.0 {InterfaceAlias, IPAddress, Addr...
[2] C:\..\Dropbox\PowerShell> Get-DscResource -Name xIPAddress -Module xNetworking -Syntax
xIPAddress [String] #ResourceName
{
InterfaceAlias = [string]
IPAddress = [string]
[AddressFamily = [string]{ IPv4 | IPv6 }]
[DependsOn = [string[]]]
[PrefixLength = [UInt32]]
[PsDscRunAsCredential = [PSCredential]]
}
[3] C:\..\Dropbox\PowerShell> You will need to have v3.2.0.0 installed on your host that you're generating the .mof files on - as this is what is defined in the example .psd1 configuration data file. If you want to use an alternate version you'll need to update the .psd1 file accordingly and make sure you have that installed on the host! |
@Panzerbjrn or as @ChrisLGardner points out - you might have a v5.x release installed where it was changed again. And this is the reason why the module versions are specified in the .psd1 file 😠! If we want to update the examples to use v5.x of the xNetworking module you will need to make a change to the .psd1 file as well in this PR. Does this make sense? |
Correct, I have version 5.2.0.0. |
@Panzerbjrn What you're seeing here is a typical DSC issue and doesn't really have anything to do with Lability. When the example was written, v3.2.0.0 of the xNetworking module would have been the latest. Unfortunately, the schema has changed again from the v5.x release. To update the example to use v5.2.0.0 of the xNetworking module - you will also need to update the node |
I'll take the blame for the schema changing in 5.x of xIPAddress. It previously didn't handle setting multiple IP addresses for a single interface and now it does but we had to merge the prefix length into the IPAddress property to support different prefixes for different addresses. |
@Panzerbjrn Does this request make sense and are you OK updating the 3 PRs? |
When running this configuration, this error occurs:
At line:27 char:17
The member 'PrefixLength' is not valid. Valid members are
'AddressFamily', 'DependsOn', 'InterfaceAlias', 'IPAddress', 'PsDscRunAsCredential'.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidInstanceProperty
#'ing out line 27 enables it to run without error.