Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

WindowsFeatureSet broken when using member Source #194

Open
Igor-X opened this issue Oct 21, 2020 · 3 comments
Open

WindowsFeatureSet broken when using member Source #194

Igor-X opened this issue Oct 21, 2020 · 3 comments
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@Igor-X
Copy link

Igor-X commented Oct 21, 2020

Failing to compile when using the Source member of WindowsFeatureSet

Configuration InstallDotNet35
{
	Import-DscResource -ModuleName PSDscResources

	node localhost
	{
		WindowsFeatureSet 'InstallDotNet35' {
			Name   = @('NET-Framework-Core')
			Source = 'C:\Temp\DotNetSrc'
			Ensure = 'Present'
		}
	}
}

The result of attempting to compile is


Configuration: C:\Program Files\PowerShell\Modules\PSDscResources\2.12.0.0\DscResources\WindowsFeatureSet\WindowsFeatureSet.schema.psm1:39
Line |
39 | Configuration WindowsFeatureSet
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The member 'Source' is not valid. Valid members are 'Credential', 'DependsOn', 'Ensure', 'IncludeAllSubFeature', 'LogPath', 'Name',
| 'PsDscRunAsCredential'.

InvalidOperation: C:\program files\powershell\7\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:3745
Line |
3745 | throw $ErrorRecord
| ~~~~~~~~~~~~~~~~~~
| Errors occurred while processing configuration 'InstallDotNet35'.


It looks like there is some conflicting documentation on whether that parameter even exists or not.

It's listed on the microsoft docs page https://docs.microsoft.com/en-us/powershell/scripting/dsc/reference/resources/windows/windowsfeaturesetresource?view=powershell-7#syntax

It's not listed on the GitHub page https://github.com/PowerShell/PSDscResources

It exists as a parameter in the file WindowsFeatureSet.schema.psm1, but isn't listed in the Comment-based Help for that function

@nshenoy
Copy link

nshenoy commented May 3, 2021

I hit this issue today. Looks like the WindowsFeatureSet proxies to the MSFT_WindowsFeature resource that lacks the Source property. This seems like a regression as previous functionality has been removed.

@PlagueHO PlagueHO added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels May 3, 2021
@PlagueHO
Copy link
Contributor

PlagueHO commented May 3, 2021

The PSDscResources module is intended to be a compatible replacement for the PSDesiredStateConfiguration module resources that come in-box with Windows. However, it does indeed look like the MSFT_WindowsFeature module is missing the Source property in the PSDscResources module.

I'm not sure how this feature has been missed out. An issue is also open on the community maintained version of this module for a similar feature: dsccommunity/xPSDesiredStateConfiguration#700

This should be an easy fix but I'll need to confirm with the team what the release schedule looks like.

@JCW-USDA
Copy link

Has this been addresses elsewhere in DSC modules? I have been searching with no luck. This is preventing moving away from older modules. Thanks for any insight

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

4 participants