Skip to content

Commit 4166d6a

Browse files
committed
Fix running in pwsh
1 parent 6f266da commit 4166d6a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

azure-pipelines.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,16 +817,22 @@ stages:
817817
$env:PATH += '{0}{1}' -f [System.IO.Path]::PathSeparator, (Join-Path -Path $env:LOCALAPPDATA -ChildPath 'dsc')
818818
# Make the built module available to the current session.
819819
./build.ps1 -Tasks noop
820+
Get-Module -Name SqlServerDsc -ListAvailable
820821
# Output DSCv3 version
821822
dsc --version
822823
# Get the list of available resources.
823824
'Native resources:'
824825
dsc resource list
825826
'Resources using adapter Microsoft.Windows/WindowsPowerShell:'
826827
dsc resource list --adapter Microsoft.Windows/WindowsPowerShell
828+
829+
$cacheFile = Join-Path $env:LocalAppData "dsc\PSAdapterCache.json"
830+
$getConfig = Get-Content -Path $cacheFile -Raw | ConvertFrom-Json
831+
Write-Verbose -Message "PSAdapterCache.json content:`n $($getConfig | Out-String)" -Verbose
832+
Write-Verbose -Message "PSAdapterCache.json content:`n $($getConfig | ConvertTo-Json -Depth 10)" -Verbose
827833
name: getDSCv3AvailableResources
828834
displayName: 'Get DSCv3 Available Resources'
829-
- powershell: |
835+
- pwsh: |
830836
# Install-DscExe installed in the path $env:LOCALAPPDATA\dsc
831837
$env:PATH += '{0}{1}' -f [System.IO.Path]::PathSeparator, (Join-Path -Path $env:LOCALAPPDATA -ChildPath 'dsc')
832838
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(

0 commit comments

Comments
 (0)