Skip to content

Commit 60ffea5

Browse files
authored
Update PSDesiredStateConfiguration to 2.0.3 and bring new test… (PowerShell#10516)
1 parent 33cff2d commit 60ffea5

File tree

7 files changed

+571
-20
lines changed

7 files changed

+571
-20
lines changed

assets/files.wxs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,6 +1699,14 @@
16991699
<File Id="fil98D6A2CAE08A408BB0215CD1DD6C7A0F" KeyPath="yes" Source="$(env.ProductSourcePath)\Modules\PSDesiredStateConfiguration\helpers\DscResourceInfo.psm1" />
17001700
</Component>
17011701
</Directory>
1702+
<Directory Name="en-US" Id="dir28499A54B1694A25BB7EFA06CAE3272E">
1703+
<Component Id="cmpAC685A1C6E354E228EB6A1DD95FF03D5" Guid="{c377f473-c4e3-4005-9424-a1711f60fdfc}">
1704+
<File Id="filD2DD9066D1A148EBB7AD542DAC529862" KeyPath="yes" Source="$(env.ProductSourcePath)\Modules\PSDesiredStateConfiguration\en-US\about_PSDesiredStateConfiguration.md" />
1705+
</Component>
1706+
</Directory>
1707+
<Component Id="cmp67C4A6FC5E48487BB31DE411CF38B0B2" Guid="{321941e8-214c-470e-9002-ee21ef600145}">
1708+
<File Id="fil747B2801746E4FFCB93000BBA1089F15" KeyPath="yes" Source="$(env.ProductSourcePath)\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.cat" />
1709+
</Component>
17021710
</Directory>
17031711
<Directory Id="dirECE37E3EC3637A365744D075BD8132E9" Name="Microsoft.PowerShell.Management">
17041712
<Component Id="cmp6DAFD01CAA3A4C67185922F445EDE495" Guid="{D4374EC0-26FC-4607-AF6B-35721698E8A5}">
@@ -3897,6 +3905,8 @@
38973905
<ComponentRef Id="cmpD7A187ADE66347E5A7550B96BA10D493" />
38983906
<ComponentRef Id="cmp827B25EEC28D4699BB29042B273C8CBF" />
38993907
<ComponentRef Id="cmp712842BFA391403DA3F21B2A4C729ED3" />
3908+
<ComponentRef Id="cmpAC685A1C6E354E228EB6A1DD95FF03D5" />
3909+
<ComponentRef Id="cmp67C4A6FC5E48487BB31DE411CF38B0B2" />
39003910
<ComponentRef Id="cmpECBD8DFB18AD451AB3D81803DECC13BF" />
39013911
<ComponentRef Id="cmp01B3850D6E55468AA84B758FDE8CA59E" />
39023912
<ComponentRef Id="cmpF6FDA6202E9D4CEF9F21A23D32571BFC" />

build.psm1

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -446,31 +446,13 @@ Fix steps:
446446
Pop-Location
447447
}
448448

449-
# publish powershell.config.json
450-
$config = @{}
451-
if ($Environment.IsWindows) {
452-
$config = @{ "Microsoft.PowerShell:ExecutionPolicy" = "RemoteSigned" }
453-
}
454-
455449
if ($ReleaseTag) {
456450
$psVersion = $ReleaseTag
457451
}
458452
else {
459453
$psVersion = git --git-dir="$PSSCriptRoot/.git" describe
460454
}
461455

462-
# ARM is cross compiled, so we can't run pwsh to enumerate Experimental Features
463-
if ((Test-IsPreview $psVersion) -and -not $Runtime.Contains("arm")) {
464-
$expFeatures = [System.Collections.Generic.List[string]]::new()
465-
& $publishPath\pwsh -noprofile -out XML -command Get-ExperimentalFeature | ForEach-Object { $expFeatures.Add($_.Name) }
466-
$config += @{ ExperimentalFeatures = $expFeatures.ToArray() }
467-
}
468-
469-
if ($config.Count -gt 0) {
470-
$configPublishPath = Join-Path -Path $publishPath -ChildPath "powershell.config.json"
471-
Set-Content -Path $configPublishPath -Value ($config | ConvertTo-Json) -Force -ErrorAction Stop
472-
}
473-
474456
if ($Environment.IsRedHatFamily -or $Environment.IsDebian9) {
475457
# add two symbolic links to system shared libraries that libmi.so is dependent on to handle
476458
# platform specific changes. This is the only set of platforms needed for this currently
@@ -501,6 +483,28 @@ Fix steps:
501483
Restore-PSModuleToBuild -PublishPath $publishPath
502484
}
503485

486+
# publish powershell.config.json
487+
$config = @{}
488+
if ($Environment.IsWindows) {
489+
$config = @{ "Microsoft.PowerShell:ExecutionPolicy" = "RemoteSigned" }
490+
}
491+
492+
# ARM is cross compiled, so we can't run pwsh to enumerate Experimental Features
493+
if ((Test-IsPreview $psVersion) -and -not $Runtime.Contains("arm")) {
494+
$json = & $publishPath\pwsh -noprofile -command {
495+
$expFeatures = [System.Collections.Generic.List[string]]::new()
496+
Get-ExperimentalFeature | ForEach-Object { $expFeatures.Add($_.Name) }
497+
ConvertTo-Json $expFeatures.ToArray()
498+
}
499+
500+
$config += @{ ExperimentalFeatures = ([string[]] ($json | ConvertFrom-Json)) }
501+
}
502+
503+
if ($config.Count -gt 0) {
504+
$configPublishPath = Join-Path -Path $publishPath -ChildPath "powershell.config.json"
505+
Set-Content -Path $configPublishPath -Value ($config | ConvertTo-Json) -Force -ErrorAction Stop
506+
}
507+
504508
# Restore the Pester module
505509
if ($CI) {
506510
Restore-PSPester -Destination (Join-Path $publishPath "Modules")

src/Modules/PSGalleryModules.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<PackageReference Include="Microsoft.PowerShell.Archive" Version="1.2.3.0" />
99
<PackageReference Include="PSReadLine" Version="2.0.0-beta4" />
1010
<PackageReference Include="ThreadJob" Version="2.0.1" />
11+
<PackageReference Include="PSDesiredStateConfiguration" Version="2.0.3" />
1112
</ItemGroup>
1213

1314
</Project>

src/powershell-unix/powershell-unix.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
</ItemGroup>
3939

4040
<ItemGroup>
41-
<PackageReference Include="PSDesiredStateConfiguration" Version="2.0" />
4241
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-*" />
4342
</ItemGroup>
4443

src/powershell-win-core/powershell-win-core.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
</ItemGroup>
5454

5555
<ItemGroup>
56-
<PackageReference Include="PSDesiredStateConfiguration" Version="2.0" />
5756
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-*" />
5857
</ItemGroup>
5958

0 commit comments

Comments
 (0)