# 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 # Clean and restore repository state git clean -fd git restore . # Execute the git pull command git pull # Check and report the result if ($LASTEXITCODE -eq 0) { Write-Host "Repository successfully updated." } else { Write-Host "Repository update failed." }