This PowerShell script streamlines the updating process for repositories cloned from AWS CodeCommit through AWS SSO/git-remote-codecommit. It examines and displays AWS SSO profiles set up in the /.aws/config folder, executing aws sso login --profile for all profiles (or a specified one based on user input) unless already logged in. The script proceeds to switch to the main branch and execute git pull to fetch the latest changes. By making use of the PowerShell ForEach-Object Parallel feature, it ensures a rapid process, necessitating PowerShell version 7 for Windows and employing xargs for Linux.
PowerShell v7 (Windows)AWS SSO Configuredaws-clixargs (Linux)
- Edit the
$file = "C:\Users\test\.aws\config"orfile="/Users/test/.aws/config"aws sso config files path - Edit the
$dir = "C:\Users\test\REPO"ordir="/Users/test/REPO"folder's path where all the repos are stored - Run the script in PowerShell v7 (Windows) or in bash (Linux)


