I seem to have an issue with my post-setup script. It seems to run up to the point of installing chocolatey. after that it stops. If i run the command manually (which is why i have the rmdir for chocolatey). It runs perfectly fine with no user intervention. Any ideas? Should i just put all of this in a single batch file and call it from the post setup? I can do it in powershell and generate myself logs, etc. so i know what's going on...
Code:
echo ===== Starting RMM Customizations
echo ===== Installing Control
msiexec /i "C:\ProgramData\RMM\ClientSetup.msi" /qn
echo ===== Configuring Power Schemes
powercfg -restoredefaultschemes
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61
powercfg -SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
powercfg /Change standby-timeout-ac 0
echo ===== Importing wireless profile
netsh wlan add profile filename="C:\ProgramData\RMM\bench.xml"
echo ===== Installing RMM Tools
msiexec /i "C:\ProgramData\RMM\SyncroSetup.msi" /qn
echo ===== Setting account Options
net accounts /maxpwage:unlimited
echo ===== Installing Chocolatey Modules
rmdir /s /q %ALLUSERSPROFILE%\chocolatey
powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
echo ===== Installing base Apps
choco install -y notepadplusplus adobereader googlechrome 7zip.install logioptionsplus
echo ===== Installing Office (Will take some time)
choco install -y --force office365business --params "'/configpath:C:\ProgramData\RMM\Office-Install-BP.xml'"
echo ===== Detecing Manufacturer for Update Utilities
for /f "tokens=2 delims==" %%a in ('wmic computersystem get manufacturer /format:list') do set manufacturer=%%a
set manufacturer=%manufacturer: =%
setlocal enabledelayedexpansion
set "first4=!manufacturer:~0,4!"
endlocal
for %%A in ("!first4!") do set "first4=%%~A"
set first4=%first4:~0,4%
set first4=%first4: =%
if /i "%first4%"=="leno" (
choco install -y lenovo-thinkvantage-system-update
) else if /i "%first4%"=="dell" (
choco install -y dellcommandupdate
)