Goal of script is to ID Archive ready folders Not specific files but any RootFolder that has NO current data
T:\RootFolder1 -> GCI through that folder - the first file w/ LastWriteTime -ge (get.date).AddDays(-1095)
spit out just “RootFolder1” to an array “Current”. So if T:\RootFolder1\Test\Temp\recentfile.docx was written to in the past 3years the entire Folder path T:\RootFolder1* considered current. And “RootFolder1” is output to array “current”
else if it gets to the end of that RootFolder1 -recurse and no files have a LastWriteTime in the past three years. Then “RootFolder1” is output to array “archive”
=============================================
This is what I am trying to do. I am also new to PS and determined to learn. So all I am asking is broad logic for me to figure out steps. Problem I am having is it does not break on first match. I think I need to incorporate GCI into a while loop? Two issues I am having is breaking out of the loop for each RootFolderN. And moving on to next RootFolderN
Regardless of all that - please do yourself and especially all people willing to help you a favour and do not use aliasses in scripts and in forums. That will make your code much easier to read, easier to understand and easier to maintain. You might take a little time to read the The Unofficial PowerShell Best Practices and Style Guide.
Thank you - I am reading over the Best Practices. Not only helpful to community coherence but it has been helpful in my understanding on the relational aspects of PS.