From f311228d6144649d70dcb500f64e44884426daab Mon Sep 17 00:00:00 2001 From: bschaper Date: Tue, 7 Jan 2025 09:38:47 -0600 Subject: [PATCH] Added Update Scripts via Git --- Login/Update-Scripts.ps1 | 18 ++++++++++++++++++ TCSE-Login.bat | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 Login/Update-Scripts.ps1 diff --git a/Login/Update-Scripts.ps1 b/Login/Update-Scripts.ps1 new file mode 100644 index 0000000..e314eb0 --- /dev/null +++ b/Login/Update-Scripts.ps1 @@ -0,0 +1,18 @@ +# Change the current directory to the Scripts directory +cd "C:\Scripts" + +# Add exception handling for the git pull command +git config --global --add safe.directory C:/Scripts + +# Execute the git pull command +git pull + +# Optional: Check the exit code of the git pull command +$LASTEXITCODE + +# Optional: Display a message based on the exit code +if ($LASTEXITCODE -eq 0) { + Write-Host "git pull successful." +} else { + Write-Host "git pull failed." +} \ No newline at end of file diff --git a/TCSE-Login.bat b/TCSE-Login.bat index 4e53d25..3ccec3c 100644 --- a/TCSE-Login.bat +++ b/TCSE-Login.bat @@ -9,6 +9,10 @@ set "LOGFILE=%LOGFILE: =0%" echo Starting setup script at %DATE% %TIME% > "%LOGFILE%" +:: Update Scripts via Git +echo Updating Scripts... +powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\Update-Scripts.ps1" + :: Enable Wake on LAN echo Checking Wake on LAN... powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\Enable-WOL.ps1"