Closed bagajjal closed 2 years ago
@kwirkykat , as we discussed offline, the devops build pipeline need some changes for this PR. Current devops pipeline calls the ".\build.ps1 -tasks pack" which does build, downloading agent, etc and publish the Nuget package before it returns to the place where I'm modifying the PSD1 and renaming the MSFT_ChefInspecResource.schema.mof to MSFT_ChefInspecResource.schema. Because of this my code changes doesn't take in effect.
To fix this we need to modify the build pipeline to call ".\build.ps1 -tasks build" and add a new task to do the rest of the tasks like downloading agent, publish the Nuget package, etc.
This PR has not been updated within 14 days
Problem statement As part of running PowerShell DSC resources on Linux, we introduced PSDSCV3 module.
PSDSCV3 module supports ONLY class based resources. PSDSCV2 module supports both script based, class based resources.
PowerShell 7.2+ doesn't come with PSDSC module. Users must download PSDSC module for DSC functionality from PSGallery. Users can choose either PSDSCV2 or PSDSCV3 module.
The native DSC resource representation is defined as a script based resource at $GuestConfiguration\source\DscResources\MSFT_ChefInSpecResource\MSFT_ChefInSpecResource.schema.mof. Given PSDSCV3 only supports class based resources, this introduced a regression.
Solution
Testing Tested on all supported PowerShell versions with PSDSCV2 and PSDSCV3 modules. PSDSCV2 module is supported on PowerShell 6.2+. Please note PSV7.2 still supports PSDSCV2. PSDSCV3 module is supported on PowerShell 7.2+.
For all the below configurations, created the native resource and tested on the ubuntu VM.
On windows,
PS5.1 with PSDSCV1.1. Test output "Amit Saraf" requested to test using this. For this I have to modify GuestConfiguration.psd1 to change the minimum supported powershell version and minor change in GuestConfiguration.psm1.
On Linux,
PSV7.2 with PDSCV2. Test output
PSV7.2 with PDSCV3. Test output