Created
November 25, 2018 10:05
-
-
Save lpatalas/914a9fcafa6810cf369b118f3533ac67 to your computer and use it in GitHub Desktop.
Missing NestedModules after updating manifest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$originalManifestPath = Join-Path $PSScriptRoot 'Original.psd1' | |
$updatedManifestPath = Join-Path $PSScriptRoot 'Updated.psd1' | |
'function Get-Root { Write-Host "Root" }' | Set-Content -Path 'RootModule.psm1' | |
'function Get-Nested { Write-Host "Nested" }' | Set-Content -Path 'NestedModule.psm1' | |
New-ModuleManifest ` | |
-Path $originalManifestPath ` | |
-NestedModules @('NestedModule.psm1') ` | |
-RootModule 'RootModule.psm1' ` | |
-FunctionsToExport @('Get-Root', 'Get-Nested') ` | |
-CmdletsToExport @() ` | |
-VariablesToExport @() ` | |
-AliasesToExport @() | |
Copy-Item ` | |
-Path $originalManifestPath ` | |
-Destination $updatedManifestPath ` | |
-Force | |
Update-ModuleManifest ` | |
-Path $updatedManifestPath | |
$originalManifest = Import-PowerShellDataFile -Path $originalManifestPath | |
$updatedManifest = Import-PowerShellDataFile -Path $updatedManifestPath | |
Write-Host 'Original:' $originalManifest.NestedModules | |
Write-Host 'Updated:' $updatedManifest.NestedModules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment