Skip to content

Commit

Permalink
Version 1.4.1
Browse files Browse the repository at this point in the history
- see changelog
  • Loading branch information
DavidGeeraerts committed Jan 28, 2022
1 parent 00c5d07 commit 93b5aca
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
13 changes: 11 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,24 @@
---


### Version 1.4.0 :new:
### Version 1.4.1 :new:

#### Added
- Check if local repo is empty go fetch from website
- build variable
- Log info output
- remove existing DCU logs before running DCU


---


### Version 1.4.0

#### Added
- Check if local repo is empty go fetch from website



### Version 1.3.0

#### Added
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ The wrapper is meant to facilitate large scale deployment and management.
Though the program can be run manually on individual machines, it's standard practice to:

- Add modules to a playbook
- Use a deployment tool such as [PsExec/PsExec64](https://docs.microsoft.com/en-us/sysinternals/downloads/psexec) for large scale deployment and management.
- Use a deployment tool such as [PsExec/PsExec64](https://docs.microsoft.com/en-us/sysinternals/downloads/psexec) for large scale deployment and management.

:warning: ***if using `PsExec` for large scale management, don't use `-e` switch!***

`-e` Can cause issues if a program is using user variables such as `%temp%`.
Since Dell-Command-Update using it's `-outputlog=` doesn't like the log path, it's using the `%TEMP%` variable [-outputlog="%temp%\DCU_SCAN.log"], which is a user variable (in this context).

Use the following `PsExec` switch `SET "$SWITCH=-h -i -d -c -f -n 10"`


## :wrench: Configuration

Expand Down
13 changes: 9 additions & 4 deletions module_utility_Dell_Command_Update.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
SETLOCAL Enableextensions
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
SET $SCRIPT_NAME=module_utility_Dell_Command_Update
SET $SCRIPT_VERSION=1.4.0
SET $SCRIPT_BUILD=20220128
SET $SCRIPT_VERSION=1.4.1
SET $SCRIPT_BUILD=20220128 0845
Title %$SCRIPT_NAME% Version: %$SCRIPT_VERSION%
mode con:cols=100
mode con:lines=44
Expand All @@ -46,7 +46,6 @@ SET "$URI_PACKAGE=https://dl.dell.com/FOLDER07870027M/1/%$DCU_PACKAGE%"
:: Local Network Repository
:: \\Server\Share
SET $LOCAL_REPO=

:: Log settings
:: Advise local storage for logging.
:: Log Directory
Expand Down Expand Up @@ -121,9 +120,12 @@ SET $CLEANUP=0
ECHO %$ISO_DATE% %TIME% [INFO] START... >> "%$LOG_D%\%$LOG_FILE%"
ECHO %$ISO_DATE% %TIME% [INFO] Script: %$SCRIPT_NAME% >> "%$LOG_D%\%$LOG_FILE%"
ECHO %$ISO_DATE% %TIME% [INFO] Script Version: %$SCRIPT_VERSION% >> "%$LOG_D%\%$LOG_FILE%"
ECHO %$ISO_DATE% %TIME% [INFO] Script Build: %$SCRIPT_BUILD% >> "%$LOG_D%\%$LOG_FILE%"
ECHO %$ISO_DATE% %TIME% [INFO] Computer: %COMPUTERNAME% >> "%$LOG_D%\%$LOG_FILE%"
ECHO %$ISO_DATE% %TIME% [INFO] User: %USERNAME% >> "%$LOG_D%\%$LOG_FILE%"
echo %$ISO_DATE% %TIME% [INFO] Log Directory: %$LOG_D% >> "%$LOG_D%\%$LOG_FILE%"
echo %$ISO_DATE% %TIME% [INFO] Local repository: %$LOCAL_REPO% >> "%$LOG_D%\%$LOG_FILE%"
echo %$ISO_DATE% %TIME% [INFO] Log shipping: %$LOG_SHIPPING% >> "%$LOG_D%\%$LOG_FILE%"
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:Dell-Check
Expand Down Expand Up @@ -265,21 +267,24 @@ SET $CLEANUP=0

:DCU-Scan
rem -outputlog= doesn't work with %$LOG_D%, using %TEMP%
if exist "%temp%\DCU_SCAN.log" DEL /F /Q "%temp%\DCU_SCAN.log"
dcu-cli.exe /scan -outputlog="%temp%\DCU_SCAN.log"
echo.
echo Scan completed.
type "%temp%\DCU_SCAN.log" >> "%$LOG_D%\%$LOG_FILE%"
find /I "Number of applicable" "%temp%\DCU_SCAN.log"> "%$LOG_D%\cache\DCU_Scan_Updates.txt"

for /f "skip=2 tokens=5 delims=:" %%P IN (%$LOG_D%\cache\DCU_Scan_Updates.txt) DO ECHO %%P> "%$LOG_D%\cache\DCU_Updates.txt"
:: remove space
for /f "tokens=1 delims= " %%P IN (%$LOG_D%\cache\DCU_Updates.txt) DO ECHO %%P> "%$LOG_D%\cache\DCU_Updates.txt"
SET /P $DCU_UPDATES= < "%$LOG_D%\cache\DCU_Updates.txt"
echo %$ISO_DATE% %TIME% [DEBUG] $DCU_UPDATES: {%$DCU_UPDATES%} >> "%$LOG_D%\%$LOG_FILE%"
if not defined $DCU_UPDATES GoTo DCU-Update
IF %$DCU_UPDATES% EQU 0 GoTo Close


:DCU-Update
rem -outputlog= doesn't work with %$LOG_D%, using %TEMP%
if exist "%TEMP%\DCU_UPDATE.log" DEL /F /Q "%TEMP%\DCU_UPDATE.log"
dcu-cli.exe /applyupdates -reboot=enable -outputlog="%TEMP%\DCU_UPDATE.log"
echo.
type "%TEMP%\DCU_UPDATE.log" >> "%$LOG_D%\%$LOG_FILE%"
Expand Down

0 comments on commit 93b5aca

Please sign in to comment.