Visual Studio project folders contains a lot of files that it generates each time you compile your project, so you don't need them when zipping the folder, what about if we could use .gitignore?
There are ways to do this :) lets check them down
Here is the link to 7zip if not installed
Steps:
-
Open a command prompt
-
Copy this into the console:
7z.exe a -t7z "C:\Destination\Path\%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2% BackupName.7z" "C:\Source\Path\FolderToBeBackup" -bd -mx9 -xr@"C:\Path\To\ExcludeListName"
-
Press Enter
The exclude list could be a copy of a .gitignore
file
If the projects are git repos, the git archive
cli command can be used
git archive HEAD -o ${PWD##*/}.zip
git archive HEAD -o ../$(Split-Path -Path ${PWD} -Leaf)-$(Get-Date -UFormat "%Y.%m.%d-%H.%M").zip