Use Modules instead of SnapIns

Proper deployment of the Modules we support allowed me to remove my
work-arounds using the deprecated SnapIn system to load all PowerShell
libraries via Modules.

I still don't like that this is done in build scripts, but we need
better asset support from .NET CLI to change how this is done.

PowerShell.Utility now deploys the CoreClr manifest, so unsupported
commands don't show up erroneously.
This commit is contained in:
Andrew Schwartzmeyer 2016-01-29 15:33:23 -08:00
parent fd782abe99
commit 52a7095056
2 changed files with 12 additions and 4 deletions

View File

@ -4,8 +4,12 @@ mkdir $BIN/Modules -ErrorAction SilentlyContinue
# Deploy PowerShell modules
cd $BIN/Modules
robocopy ../../test/Pester Pester /s /e
robocopy ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility Microsoft.PowerShell.Utility /s /e
robocopy ../../test/Pester Pester /s /e
robocopy ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility Microsoft.PowerShell.Utility /s /e
cp ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility/CoreClr/* Microsoft.PowerShell.Utility
robocopy ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Security Microsoft.PowerShell.Security /s /e
robocopy ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Management Microsoft.PowerShell.Management /s /e
robocopy ../../src/monad/monad/miscfiles/modules/PSDiagnostics PSDiagnostics /s /e
cd ../..
# Publish PowerShell

View File

@ -7,8 +7,12 @@ mkdir -p $BIN/Modules
# Deploy PowerShell modules
(
cd $BIN/Modules
ln -sf ../../test/Pester .
ln -sf ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility .
cp -r ../../test/Pester .
cp -r ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility .
cp ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility/CoreClr/* Microsoft.PowerShell.Utility
cp -r ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Security .
cp -r ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Management .
cp -r ../../src/monad/monad/miscfiles/modules/PSDiagnostics .
OMI=Microsoft.PowerShell.Commands.Omi
mkdir -p $OMI
ln -sf $BIN/$OMI.dll $OMI/