w10install/scripts/unpack-pspackages.cmd

38 lines
742 B
Batchfile
Raw Permalink Normal View History

@echo off
2023-02-20 09:24:42 +01:00
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 ...
2023-02-04 23:28:40 +01:00
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 #######