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:
parent
fd782abe99
commit
52a7095056
@ -4,8 +4,12 @@ mkdir $BIN/Modules -ErrorAction SilentlyContinue
|
|||||||
|
|
||||||
# Deploy PowerShell modules
|
# Deploy PowerShell modules
|
||||||
cd $BIN/Modules
|
cd $BIN/Modules
|
||||||
robocopy ../../test/Pester Pester /s /e
|
robocopy ../../test/Pester Pester /s /e
|
||||||
robocopy ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility Microsoft.PowerShell.Utility /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 ../..
|
cd ../..
|
||||||
|
|
||||||
# Publish PowerShell
|
# Publish PowerShell
|
||||||
|
8
build.sh
8
build.sh
@ -7,8 +7,12 @@ mkdir -p $BIN/Modules
|
|||||||
# Deploy PowerShell modules
|
# Deploy PowerShell modules
|
||||||
(
|
(
|
||||||
cd $BIN/Modules
|
cd $BIN/Modules
|
||||||
ln -sf ../../test/Pester .
|
cp -r ../../test/Pester .
|
||||||
ln -sf ../../src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility .
|
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
|
OMI=Microsoft.PowerShell.Commands.Omi
|
||||||
mkdir -p $OMI
|
mkdir -p $OMI
|
||||||
ln -sf $BIN/$OMI.dll $OMI/
|
ln -sf $BIN/$OMI.dll $OMI/
|
||||||
|
Loading…
Reference in New Issue
Block a user