38 lines
742 B
Batchfile
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 #######
|
|
|