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

xIEEsc | xUac: Error thrown during MOF compilation since version 1.5.0 #34

Closed
fullenw1 opened this issue Feb 3, 2020 · 7 comments · Fixed by #35
Closed

xIEEsc | xUac: Error thrown during MOF compilation since version 1.5.0 #34

fullenw1 opened this issue Feb 3, 2020 · 7 comments · Fixed by #35
Labels
bug The issue is a bug.

Comments

@fullenw1
Copy link

fullenw1 commented Feb 3, 2020

Details of the scenario you tried and the problem that is occurring

I am already using the module since version 1.4.0.0
I didn't change the configuration, and only upgraded the module to version 1.5.0.
Since then the MOF compilation is throwing an error.
When I change the module version back to 1.4.0 (without any other change), the compilation is working fine again.

Verbose logs showing the problem

VERBOSE: 	Result found for xSystemSecurity
PSDesiredStateConfiguration\Node : The term 'xIEEsc\xIEEsc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At New-DscMof.ps1:140 char:5
+     Node $AllNodes.NodeName {
+     ~~~~
    + CategoryInfo          : ObjectNotFound: (xIEEsc\xIEEsc:String) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node
 
Compilation errors occurred while processing configuration 'New-DscConfiguration'. Please review the errors reported in error stream and modify your configuration code appropriately.
    + CategoryInfo          : InvalidOperation: (New-DscConfiguration:String) [], InvalidOperationException
    + FullyQualifiedErrorId : FailToProcessConfiguration

Or when I comment out the xIEEsc section I have the following error message:

VERBOSE: 	Result found for xSystemSecurity
PSDesiredStateConfiguration\Node : The term 'xUAC\xUac' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At New-DscMof.ps1:140 char:5
+     Node $AllNodes.NodeName {
+     ~~~~
    + CategoryInfo          : ObjectNotFound: (xUAC\xUac:String) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException,PSDesiredStateConfiguration\node
 
Compilation errors occurred while processing configuration 'New-DscConfiguration'. Please review the errors reported in error stream and modify your configuration code appropriately.
    + CategoryInfo          : InvalidOperation: (New-DscConfiguration:String) [], InvalidOperationException
    + FullyQualifiedErrorId : FailToProcessConfiguration

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Here is the Datum configuration:

xSystemSecurity:
  xIEEsc:
    - UserRole: Administrators
      IsEnabled: False
  xUac:
    Setting: AlwaysNotify

The operating system the target node is running

NA because the problem appears during the creation of the MOF.

Version and build of PowerShell the target node is running

NA because the problem appears during the creation of the MOF.

Version of the DSC module that was used

1.5.0

@johlju
Copy link
Member

johlju commented Feb 8, 2020

Not sure why that happened, the module output looks the same to me. 🤔 Both these resources are pending deprecation, but happy to merge a fix if anyone can debug and send in a PR (before deprecation).

Try the new resources:

The resource xIEEsc has been refactored and merged to the module ComputerManagementDsc as IEEnhancedSecurityConfiguration. The resource xUac has also been refactored as UserAccountControl and is pending review in the module ComputerManagementDsc.

IEEnhancedSecurityConfiguration will be part of the v8.0.0-preview0001 in the PowerShell Gallery (hopefully in a few minutes). Here is the release notes so far at least:
https://github.com/dsccommunity/ComputerManagementDsc/releases/tag/v8.0.0-preview0001

UserAccountControl will be released as soon as it is merged.

Report any findings to the repository https://github.com/dsccommunity/ComputerManagementDsc

@johlju johlju added needs more information The issue needs more information from the author or the community. needs investigation The issue needs to be investigated by the maintainers or/and the community. and removed needs more information The issue needs more information from the author or the community. labels Feb 8, 2020
@johlju
Copy link
Member

johlju commented Feb 8, 2020

I can only see two things that could potentially do this. Either this that the below was added to the module manifest in v1.5.0, or the change to semantic version. Can someone verify if removing the below from the module manifest in 1.5.0 solve the compilation issue?

    DscResourcesToExport = @(
        'xIEEsc'
        'xUAC'
        'xFileSystemAccessRule'
    )

@fullenw1
Copy link
Author

I found the reason.
It is the same one as for the latest version of the ComputerManagementDsc module.
Those 2 resources are not part of the module published on PSGallery.

PS> Get-DscResource -Module xSystemSecurity | Where-Object -Property Version -EQ '1.5.0'

ImplementedAs   Name                      ModuleName                     Version    Properties                                        
-------------   ----                      ----------                     -------    ----------                                        
PowerShell      xFileSystemAccessRule     xSystemSecurity                1.5.0      {Identity, Path, DependsOn, Ensure...}

PS>

@johlju
Copy link
Member

johlju commented Feb 12, 2020

But the resource code is present in the downloaded module right? Could you please also remove the property I mention above from the module manifest and see if finds the resources after that? 🤔

@johlju
Copy link
Member

johlju commented Feb 12, 2020

So it seems these lines need to be reverted back to FunctionsToExport = '*', or rather FunctionsToExport = @('xIEESc') and FunctionsToExport = @('xUAC') respectively.

FunctionsToExport = @()

@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. and removed needs investigation The issue needs to be investigated by the maintainers or/and the community. labels Feb 12, 2020
@johlju
Copy link
Member

johlju commented Feb 12, 2020

If someone can send in a PR with this change it would be much appreciated. No unit tests needed.

@fullenw1
Copy link
Author

@johlju

Those resources are now available in the ComputerManagementDSC module v8.0.0 which has just been released.
I think we can close the issue :)

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Mar 9, 2020
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants