Samer
Samer

Reputation: 4196

powershell dsc version 3.8.0.0 installation

I installed the new release of ps DSC 3.8.0.0 using:

Find-Module -Name xpsd* | Install-Module

I'm sure that as I'm writing this question, I had already restarted my PC at least once. The problem is that the older version (3.7.0.0) DSC resource intellisense is what keeps appearing. Practically it's like the new module was never installed.

I attempted to delete the older dsc resources using:

Get-DSCResource | Where-Object{$_.Version -eq '3.7.0.0'} | Remove-Item

Which resulted in the modules not deleted but corrupted since they were listed as:

ImplementedAs   Name                      ModuleName                     Version    Properties                                        
-------------   ----                      ----------                     -------    ----------                                        
Binary          File                                                                {DestinationPath, Attributes, Checksum, Content...

Initially their ImplementedAs property had the value of PowerShell, which changed to Binary after the Remove-Item command. Also, their ModuleName and Version properties were populated correctly, before they became corrupted.

Using the $env:PSModulePath, I was able to locate the 3.7.0.0 folder and I deleted it.

Though the modules no longer show in the list retrieved by 'Get-DSCResource', I'm left with two problems:

1) How can I get DSC to use the new 3.8.0.0 resources, and its corresponding parameters?

Note: I tried Find-Module -Name xpsd* | Install-Module -Force which caused no improvement.

Upvotes: 2

Views: 137

Answers (2)

Samer
Samer

Reputation: 4196

Apparently the github documentation claim that there is a Version property in the xPackage resource is not accurate.

How do I know?

$res = Get-DSCResource xPackage
$res.Properties

The list of property items did NOT include a Version property. Thus, the DSC compiler was successfully using the newer version 3.8.0.0, which to my surprise was followed by a newer release 3.9.0.0 within 3 weeks. The previous 3.7.0.0 release was published 13 months before the 3.8.0.0 release!!!

Upvotes: -1

Nana Lakshmanan
Nana Lakshmanan

Reputation: 739

xPSDesiredStateConfiguration is the experimental module which we have made available in the gallery whereas PSDesiredStateConfiguration is what ships in box. In order to use resources from a module, you need to import is using the Import-DscResource statement

Import-DscResource -ModuleName xPSDesiredStateConfiguration

Then you can use the resources as under:

xService MyService
{
}

Note that the resource names are different as well - with the ones in xPSDesiredStateConfiguration having the "x" prefix in front of them

Upvotes: 2

Related Questions