Skip to content

Commit

Permalink
Update PSDesiredStateConfiguration to 2.0.3 and bring new test… (Powe…
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisEz13 authored Sep 12, 2019
1 parent 33cff2d commit 60ffea5
Show file tree
Hide file tree
Showing 7 changed files with 571 additions and 20 deletions.
10 changes: 10 additions & 0 deletions assets/files.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,14 @@
<File Id="fil98D6A2CAE08A408BB0215CD1DD6C7A0F" KeyPath="yes" Source="$(env.ProductSourcePath)\Modules\PSDesiredStateConfiguration\helpers\DscResourceInfo.psm1" />
</Component>
</Directory>
<Directory Name="en-US" Id="dir28499A54B1694A25BB7EFA06CAE3272E">
<Component Id="cmpAC685A1C6E354E228EB6A1DD95FF03D5" Guid="{c377f473-c4e3-4005-9424-a1711f60fdfc}">
<File Id="filD2DD9066D1A148EBB7AD542DAC529862" KeyPath="yes" Source="$(env.ProductSourcePath)\Modules\PSDesiredStateConfiguration\en-US\about_PSDesiredStateConfiguration.md" />
</Component>
</Directory>
<Component Id="cmp67C4A6FC5E48487BB31DE411CF38B0B2" Guid="{321941e8-214c-470e-9002-ee21ef600145}">
<File Id="fil747B2801746E4FFCB93000BBA1089F15" KeyPath="yes" Source="$(env.ProductSourcePath)\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.cat" />
</Component>
</Directory>
<Directory Id="dirECE37E3EC3637A365744D075BD8132E9" Name="Microsoft.PowerShell.Management">
<Component Id="cmp6DAFD01CAA3A4C67185922F445EDE495" Guid="{D4374EC0-26FC-4607-AF6B-35721698E8A5}">
Expand Down Expand Up @@ -3897,6 +3905,8 @@
<ComponentRef Id="cmpD7A187ADE66347E5A7550B96BA10D493" />
<ComponentRef Id="cmp827B25EEC28D4699BB29042B273C8CBF" />
<ComponentRef Id="cmp712842BFA391403DA3F21B2A4C729ED3" />
<ComponentRef Id="cmpAC685A1C6E354E228EB6A1DD95FF03D5" />
<ComponentRef Id="cmp67C4A6FC5E48487BB31DE411CF38B0B2" />
<ComponentRef Id="cmpECBD8DFB18AD451AB3D81803DECC13BF" />
<ComponentRef Id="cmp01B3850D6E55468AA84B758FDE8CA59E" />
<ComponentRef Id="cmpF6FDA6202E9D4CEF9F21A23D32571BFC" />
Expand Down
40 changes: 22 additions & 18 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -446,31 +446,13 @@ Fix steps:
Pop-Location
}

# publish powershell.config.json
$config = @{}
if ($Environment.IsWindows) {
$config = @{ "Microsoft.PowerShell:ExecutionPolicy" = "RemoteSigned" }
}

if ($ReleaseTag) {
$psVersion = $ReleaseTag
}
else {
$psVersion = git --git-dir="$PSSCriptRoot/.git" describe
}

# ARM is cross compiled, so we can't run pwsh to enumerate Experimental Features
if ((Test-IsPreview $psVersion) -and -not $Runtime.Contains("arm")) {
$expFeatures = [System.Collections.Generic.List[string]]::new()
& $publishPath\pwsh -noprofile -out XML -command Get-ExperimentalFeature | ForEach-Object { $expFeatures.Add($_.Name) }
$config += @{ ExperimentalFeatures = $expFeatures.ToArray() }
}

if ($config.Count -gt 0) {
$configPublishPath = Join-Path -Path $publishPath -ChildPath "powershell.config.json"
Set-Content -Path $configPublishPath -Value ($config | ConvertTo-Json) -Force -ErrorAction Stop
}

if ($Environment.IsRedHatFamily -or $Environment.IsDebian9) {
# add two symbolic links to system shared libraries that libmi.so is dependent on to handle
# platform specific changes. This is the only set of platforms needed for this currently
Expand Down Expand Up @@ -501,6 +483,28 @@ Fix steps:
Restore-PSModuleToBuild -PublishPath $publishPath
}

# publish powershell.config.json
$config = @{}
if ($Environment.IsWindows) {
$config = @{ "Microsoft.PowerShell:ExecutionPolicy" = "RemoteSigned" }
}

# ARM is cross compiled, so we can't run pwsh to enumerate Experimental Features
if ((Test-IsPreview $psVersion) -and -not $Runtime.Contains("arm")) {
$json = & $publishPath\pwsh -noprofile -command {
$expFeatures = [System.Collections.Generic.List[string]]::new()
Get-ExperimentalFeature | ForEach-Object { $expFeatures.Add($_.Name) }
ConvertTo-Json $expFeatures.ToArray()
}

$config += @{ ExperimentalFeatures = ([string[]] ($json | ConvertFrom-Json)) }
}

if ($config.Count -gt 0) {
$configPublishPath = Join-Path -Path $publishPath -ChildPath "powershell.config.json"
Set-Content -Path $configPublishPath -Value ($config | ConvertTo-Json) -Force -ErrorAction Stop
}

# Restore the Pester module
if ($CI) {
Restore-PSPester -Destination (Join-Path $publishPath "Modules")
Expand Down
1 change: 1 addition & 0 deletions src/Modules/PSGalleryModules.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageReference Include="Microsoft.PowerShell.Archive" Version="1.2.3.0" />
<PackageReference Include="PSReadLine" Version="2.0.0-beta4" />
<PackageReference Include="ThreadJob" Version="2.0.1" />
<PackageReference Include="PSDesiredStateConfiguration" Version="2.0.3" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion src/powershell-unix/powershell-unix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PSDesiredStateConfiguration" Version="2.0" />
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-*" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/powershell-win-core/powershell-win-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PSDesiredStateConfiguration" Version="2.0" />
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-*" />
</ItemGroup>

Expand Down
Loading

0 comments on commit 60ffea5

Please sign in to comment.