w10install/scripts/unpack-pspackages.cmd
Michael H.G. Schmidt 1a89bb1ebc hardcoding removsal
2023-02-20 09:24:42 +01:00

38 lines
742 B
Batchfile

@echo off
set TOOLS=%SystemDrive%\tools
set SOFTWARE=..\software
set TARGET="%ProgramFiles%\WindowsPowerShell\Modules"
echo ####### %0 #######
rem ######################################
rem MAIN loop ( unzip nuget packages ) ...
rem ######################################
for %%A in (
PSWindowsUpdate
) do (
if NOT EXIST %SOFTWARE%\%%A.nupkg (
echo WARNING: %SOFTWARE%\%%A.nupkg not found!
) else (
rem cleanup ...
rd /S /Q %TARGET%\%%A 2>nul
echo unpacking %%A.nupkg ...
%TOOLS%\7z e -y -aoa -o%TARGET%\%%A %SOFTWARE%\%%A.nupkg 1>nul
echo importing module [ %%A ] ...
powershell -Command "Import-Module -Name %%A"
)
)
echo ####### %0 #######