@@ -1659,6 +1659,7 @@ function New-ILNugetPackage
1659
1659
}
1660
1660
1661
1661
$fileList = @ (
1662
+ " Microsoft.Management.Infrastructure.CimCmdlets.dll" ,
1662
1663
" Microsoft.PowerShell.Commands.Diagnostics.dll" ,
1663
1664
" Microsoft.PowerShell.Commands.Management.dll" ,
1664
1665
" Microsoft.PowerShell.Commands.Utility.dll" ,
@@ -1672,14 +1673,14 @@ function New-ILNugetPackage
1672
1673
" Microsoft.PowerShell.MarkdownRender.dll" )
1673
1674
1674
1675
$linuxExceptionList = @ (
1676
+ " Microsoft.Management.Infrastructure.CimCmdlets.dll" ,
1675
1677
" Microsoft.PowerShell.Commands.Diagnostics.dll" ,
1676
1678
" Microsoft.PowerShell.CoreCLR.Eventing.dll" ,
1677
1679
" Microsoft.WSMan.Management.dll" ,
1678
1680
" Microsoft.WSMan.Runtime.dll" )
1679
1681
1680
1682
if ($PSCmdlet.ShouldProcess (" Create nuget packages at: $PackagePath " ))
1681
1683
{
1682
-
1683
1684
$refBinPath = New-TempFolder
1684
1685
$SnkFilePath = " $RepoRoot \src\signing\visualstudiopublic.snk"
1685
1686
@@ -1715,13 +1716,54 @@ function New-ILNugetPackage
1715
1716
$contentFolder = New-Item (Join-Path $filePackageFolder " contentFiles\any\any" ) - ItemType Directory - Force
1716
1717
$dotnetRefAsmFolder = Join-Path - Path $WinFxdBinPath - ChildPath " ref"
1717
1718
Copy-Item - Path $dotnetRefAsmFolder - Destination $contentFolder - Recurse - Force
1719
+ Write-Log " Copied the reference assembly folder to contentFiles for the SDK package"
1720
+
1721
+ # Copy the built-in module folders to the NuGet package, so 'dotnet publish' can deploy those modules to the $pshome module path.
1722
+ # This is for enabling applications that hosts PowerShell to ship the built-in modules.
1723
+
1724
+ $winBuiltInModules = @ (
1725
+ " CimCmdlets" ,
1726
+ " Microsoft.PowerShell.Diagnostics" ,
1727
+ " Microsoft.PowerShell.Host" ,
1728
+ " Microsoft.PowerShell.Management" ,
1729
+ " Microsoft.PowerShell.Security" ,
1730
+ " Microsoft.PowerShell.Utility" ,
1731
+ " Microsoft.WSMan.Management" ,
1732
+ " PSDiagnostics"
1733
+ )
1734
+
1735
+ $unixBuiltInModules = @ (
1736
+ " Microsoft.PowerShell.Host" ,
1737
+ " Microsoft.PowerShell.Management" ,
1738
+ " Microsoft.PowerShell.Security" ,
1739
+ " Microsoft.PowerShell.Utility"
1740
+ )
1741
+
1742
+ $winModuleFolder = New-Item (Join-Path $contentFolder " runtimes\win\lib\netcoreapp3.1\Modules" ) - ItemType Directory - Force
1743
+ $unixModuleFolder = New-Item (Join-Path $contentFolder " runtimes\unix\lib\netcoreapp3.1\Modules" ) - ItemType Directory - Force
1744
+
1745
+ foreach ($module in $winBuiltInModules ) {
1746
+ $source = Join-Path $WinFxdBinPath " Modules\$module "
1747
+ Copy-Item - Path $source - Destination $winModuleFolder - Recurse - Force
1748
+ }
1749
+
1750
+ foreach ($module in $unixBuiltInModules ) {
1751
+ $source = Join-Path $LinuxFxdBinPath " Modules\$module "
1752
+ Copy-Item - Path $source - Destination $unixModuleFolder - Recurse - Force
1753
+ }
1754
+
1755
+ Write-Log " Copied the built-in modules to contentFiles for the SDK package"
1718
1756
}
1719
1757
1720
1758
# region nuspec
1721
1759
# filed a tracking bug for automating generation of dependecy list: https://github.com/PowerShell/PowerShell/issues/6247
1722
1760
$deps = [System.Collections.ArrayList ]::new()
1723
1761
1724
1762
switch ($fileBaseName ) {
1763
+ ' Microsoft.Management.Infrastructure.CimCmdlets' {
1764
+ $deps.Add ([tuple ]::Create([tuple ]::Create(' id' , ' System.Management.Automation' ), [tuple ]::Create(' version' , $PackageVersion ))) > $null
1765
+ }
1766
+
1725
1767
' Microsoft.PowerShell.Commands.Diagnostics' {
1726
1768
$deps.Add ([tuple ]::Create([tuple ]::Create(' id' , ' System.Management.Automation' ), [tuple ]::Create(' version' , $PackageVersion ))) > $null
1727
1769
}
@@ -1771,6 +1813,7 @@ function New-ILNugetPackage
1771
1813
}
1772
1814
$deps.Add ([tuple ]::Create([tuple ]::Create(' id' , ' Microsoft.WSMan.Management' ), [tuple ]::Create(' version' , $PackageVersion ))) > $null
1773
1815
$deps.Add ([tuple ]::Create([tuple ]::Create(' id' , ' Microsoft.PowerShell.Commands.Diagnostics' ), [tuple ]::Create(' version' , $PackageVersion ))) > $null
1816
+ $deps.Add ([tuple ]::Create([tuple ]::Create(' id' , ' Microsoft.Management.Infrastructure.CimCmdlets' ), [tuple ]::Create(' version' , $PackageVersion ))) > $null
1774
1817
}
1775
1818
1776
1819
' Microsoft.PowerShell.Security' {
0 commit comments