Posts

Showing posts with the label Robocopy

Windows PowerShell script and commands to list files and folders modified in past x days excluding specified folders like .git and node_modules (helps in backup)

Last updated on 5 Mar. 2025 5 Mar. 2025 Update I am too squeezed for time to update this post. The latest scripts are available on my public GitHub repo:  https://github.com/ravisiyer/PS-Scripts  . end- 5 Mar. 2025 Update Quick-Info ExcludeDirsRecurseListFilesDirs.ps1 : Recursively outputs Get-ChildItem returned object for files and directories of current working directory OR user specified directory but excludes folders and their contents present in $ExcludeFolders variable in script. Usage: script-name [optional-path] | next-cmd  ... The next-cmd is important for making this script useful. An example: Lists last modified time followed by full path for each folder & file in current directory that was last modifed on 4.05.2024 (4th May) or 5.05.2024 excluding folders whose names are in $ExcludeFolders and such folders' contents script-name | where { ((get-date('5.05.2024'))-$_.LastWriteTime).days -lt 1 } |  ForEach-Object {"$($_.LastWriteTime) $($_.FullName)"}...

Using robocopy to copy folder without node_modules subfolder(s) and using WinMerge and TreeSize to check

Last updated on 5 Mar. 2025 5 Mar. 2025 Update I am too squeezed for time to update this post. The latest scripts are available on my public GitHub repo:  https://github.com/ravisiyer/PS-Scripts  . end- 5 Mar. 2025 Update Note: This post is a details-post for the post: Learning web app development through free online tutorials – Organized Notes and Log,  https://raviswdev.blogspot.com/2024/03/learning-web-app-development-through.html  . React and Node program directories have lots of files due to node_modules directory. For backup purposes, copying main source code of these directories is a challenge as node_modules should ideally be skipped. Individual project directory copy can be done manually by excluding node_modules - that is no problem. The problem crops up for backing up many such projects (in my case, typically as part of a backup done after 2 to 3 months of all required data to USB backup drive) as manual exclusion will be too time-consuming.  Win...