diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index a68c40a3e6..f47482ff27 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -22,7 +22,7 @@ on: jobs: copilot-setup-steps: name: Setup SqlServerDsc Development Environment - runs-on: windows-latest + runs-on: ubuntu-latest # Set the permissions to the lowest permissions possible needed for your steps. # Copilot will be given its own token for its operations. @@ -36,18 +36,32 @@ jobs: with: fetch-depth: 0 # Full history needed for GitVersion - - name: Setup PowerShell Environment + - name: Configure PowerShell Environment shell: pwsh run: | - Write-Host "Setting up PowerShell environment..." -ForegroundColor Green + Write-Host "Configure PowerShell environment..." -ForegroundColor Green # Install dependent PowerShell modules Install-PSResource -Name 'SqlServer' -Version '21.1.18256' -Scope 'CurrentUser' -Repository 'PSGallery' -TrustRepository + Install-PSResource -Name 'PSDSC' -Scope 'CurrentUser' -Repository 'PSGallery' -TrustRepository - # Set execution policy for development - Set-ExecutionPolicy -ExecutionPolicy 'RemoteSigned' -Scope 'CurrentUser' -Force + Write-Host "PowerShell environment configuration complete." -ForegroundColor Green - Write-Host "PowerShell environment setup complete." -ForegroundColor Green + - name: Install DSCv3 + shell: pwsh + run: | + Write-Host "Install DSCv3 in environment..." -ForegroundColor Green + + # Install dependent PowerShell modules + Install-DscExe -IncludePrerelease -Force + + Write-Host "DSCv3 install complete." -ForegroundColor Green + + - name: Verify DSCv3 + shell: pwsh + run: | + Write-Host "Running DSCv3 to validate correct operation..." -ForegroundColor Green + dsc --version - name: Install .NET Tools shell: pwsh @@ -115,8 +129,8 @@ jobs: $commands = Get-Command -Module SqlServerDsc Write-Host " Exported Commands: $($commands.Count)" -ForegroundColor Cyan - $dscResources = Get-DscResource -Module SqlServerDsc - Write-Host " DSC Resources: $($dscResources.Count)" -ForegroundColor Cyan + $dscResources = @(dsc resource list --adapter Microsoft.DSC/PowerShell --output-format json | ConvertFrom-Json) + Write-Host " Available class-based DSC Resources: $($dscResources.Count)" -ForegroundColor Cyan } else { Write-Error "Failed to import module" exit 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index f2270895ef..b9dc37b7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added setup workflow for GitHub Copilot. + - Switch the workflow to use Linux. ### Changed