Dear all,
I’m just starting at this but I’m stuck in a very simple thing and “Google is not answering me”. I don’t have any knowlage about PowerShell, but sometimes I give a try on simple things to help me on daily basis problems. This week I was trying to upload around 23000 pics to Google Photos and… well, they don’t have any Folder organization system! So (maybe this was not a good decision) I decided to change my folder structure to make it easier for me to organize with albums later.
I’ll try to explain what I want. Any idea, even to make it easier without any code, is welcome:
My folders are like this (1):
\Photos
-2010
–Home
–Beach
–Rio de Janeiro
-2011
–Home
–Sao Paulo
–Rio de Janeiro
—Hotel
—Beach
–Panama
…
What I tried to do was a simple “Rename-Item” to add, at least, the year at the beginning of every folder. Like this (2):
\Photos
-2010
–2010-Home
–2010-Beach
–2010-Rio de Janeiro
-2011
–2011-Home
–2011-Sao Paulo
–2011-Rio de Janeiro
—2011-Hotel
—2011-Beach
–2011-Panama
…
Or, if possible, maybe combining the whole path in the name of the last path, like this (3):
\Photos
-2010
–2010-Home
–2010-Beach
–2010-Rio de Janeiro
-2011
–2011-Home
–2011-Sao Paulo
–2011-Rio de Janeiro
—2011-Rio de Janeiro-Hotel
—2011-Rio de Janeiro-Beach
–2011-Panama
…
I tried to do the easier I could (2), adding only the yar at the begnnining, but it doesn’t change the name of the folder if there is any folder inside. It’s like “C:\Photos\2011\Rio de Janeiro\Hotel” for example.
This is the “code” I tried. I don’t know how to make it look like a code:
$folders = Get-ChildItem -Path C:\Photos -Directory $year = "2010" #I would do year by year ForEach ($item in $folders) {Rename-Item -Path $item.FullName -NewName ($year + " " + $item.Name)}
Thanks in advance for any help!