Quantcast
Channel: psappdeploytoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1769

New Post: SCCM Return Codes

$
0
0
We use a CMD wrapper in front of the PSADTK for legacy reasons:
set "_Powershell=%SYSTEMROOT%\system32\WindowsPowerShell\v1.0\powershell.exe"

"%_Powershell%" "& '%~dp0%FN%.ps1' Install NonInteractive "; exit $LASTEXITCODE
SET ERR=%ERRORLEVEL%
REM CAVEAT: we may get the wrong Exit code in PowerShell v2 (e.g. syntax error=0)

ECHO [%~NX0] SCCM RESULT CODE=%ERR%
TIMEOUT.exe /T 10 /NOBREAK 1>nul 2>nul

EXIT /B %ERR%
Notice the exit $LASTEXITCODE

You might be able to use that directly in CM12.

Viewing all articles
Browse latest Browse all 1769

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>