I am a Node developer, and want to keep all my work saved in Dropbox except for the big 'node_modules' directories. I found a Powershell code that selectively ignores a folder existent in Dropbox in https://help.dropbox.com/files-folders/restore-delete/ignored-files:
Set-Content -Path 'C:\Users\yourname\Dropbox(Personal)\YourFileName.pdf' -Stream com.dropbox.ignored -Value 1
I want to create a Powershell script to help me find all 'node_modules' directories under Dropbox and then ignore them. I really need your help, because I really do not know much about Powershell.
Searching the Intenet, I wrote this little code snippet to recursively find all the 'node_modules' directories inside the Dropbox folder.
$BaseDir = "C:\Users\giann\Dropbox\IdeaProjects"
$NameToFind = "node_modules"
$MyVariable = Get-ChildItem $BaseDir -Recurse | Where-Object { $_.PSIsContainer -and $_.Name.EndsWith($NameToFind)}
My question is, how can I combine the two code snippets? Can you please point me in the right direction?
Thank you, your support is greatly appreciated.