How to fix below error related to Powershell DSC for Linux

Ghanwat, Amit 0 Reputation points
2024-02-08T13:25:28.29+00:00

I am trying to test Powershell DSC configuration package for Linux on RHEL and Ubuntu.

Getting below error while testing the configuration package.
Start-GuestConfigurationPackageRemediation -Path ./Filecreation.zip

Error: Failed to Run Consistency for 'Filecreation' Error : The term 'MSFT_nxFileResource' is not recognized as the name of a Resource. The term 'MSFT_nxFileResource' is not recognized as the name of a Resource. The PowerShell DSC resource with className:MSFT_nxFileResource moduleName:nx moduleVersion:1.0 threw an exception: Microsoft.PowerShell.Commands.WriteErrorException: The term 'MSFT_nxFileResource' is not recognized as the name of a Resource., while running the Get-DscResource functionality couldn't find PowerShell DSC resource with moduleName:nx moduleVersion:1.0 className:MSFT_nxFileResource couldn't find PowerShell DSC resource with moduleName:nx moduleVersion:1.0 className:MSFT_nxFileResource LCM failed to start desired state configuration manually. Write-Error: Job 8b954ea2-d6a8-474b-bab9-407b470202c6 : MIResult: 1 Error Message: The term 'MSFT_nxFileResource' is not recognized as the name of a Resource. Message ID: OMI:MI_Result:1 Error Category: 0 Error Code: 1 Error Type: Write-Error: Job 8b954ea2-d6a8-474b-bab9-407b470202c6 : MIResult: 1 Error Message: The term 'MSFT_nxFileResource' is not recognized as the name of a Resource. Message ID: OMI:MI_Result:1 Error Category: 0 Error Code: 1 Error Type: Write-Error: Job 8b954ea2-d6a8-474b-bab9-407b470202c6 : MIResult: 1 Error Message: The PowerShell DSC resource with className:MSFT_nxFileResource moduleName:nx moduleVersion:1.0 threw an exception: Microsoft.PowerShell.Commands.WriteErrorException: The term 'MSFT_nxFileResource' is not recognized as the name of a Resource., while running the Get-DscResource functionality Message ID: OMI:MI_Result:1 Error Category: 0 Error Code: 1 Error Type: Write-Error: Job 8b954ea2-d6a8-474b-bab9-407b470202c6 : MIResult: 1 Error Message: couldn't find PowerShell DSC resource with moduleName:nx moduleVersion:1.0 className:MSFT_nxFileResource Message ID: OMI:MI_Result:1 Error Category: 0 Error Code: 1 Error Type: Write-Error: Job 8b954ea2-d6a8-474b-bab9-407b470202c6 : MIResult: 1 Error Message: couldn't find PowerShell DSC resource with moduleName:nx moduleVersion:1.0 className:MSFT_nxFileResource LCM failed to start desired state configuration manually. Message ID: OMI:MI_Result:1 Error Category: 0 Error Code: 1 Error Type: additionalProperties : {} assignmentName : Filecreation complianceStatus : False endTime : 2/8/2024 11:47:00 AM jobId : 8b954ea2-d6a8-474b-bab9-407b470202c6 operationtype : Deployment resources : {@{complianceStatus=False; properties=; reasons=System.Object[]}} startTime : 2/8/2024 11:47:00 AM

References: https://learn.microsoft.com/en-us/powershell/dsc/reference/resources/linux/lnxfileresource?view=dsc-1.1

https://learn.microsoft.com/en-us/azure/governance/machine-configuration/how-to/develop-custom-package/3-test-package

I have tried installing the NX module on Linux VMs manually but the issue is same.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,405 questions
{count} votes