What I want to do, however, is pull from the text file the list of dates, create a folder for each, and then have the URL generate according to that list as well. I know I cannot do this with a static variable, and may possibly use a foreach loop, but this is way beyond me. Any advice or help is appreciated!
-edit
I have found something similar, and it looks like I can tweak it.
However, I’m definitely stumped on creating the unique URL using each line as a variable.
When I was first learning powershell the foreach loop was like a watershed moment for me. It just made more sense after that.
Edit to add:
The $d has nothing to do with a built in $date.
Before the foreach loop we build a variable ($textDate) with content from your text file. (you can type in $textdate.count to see how many elements are in it). Then in the foreach loop we tell it for every item ($d) in $textdate do {something}.
I could have also called it foreach ($potato in $textDate){write-host $potato} to get the same effect.
I might have yelled “Eureka” out loud in the office when I modified it, ran it, and it started doing things automatically.
Theoretically.
And - okay, so the logic I’m seeing is that you are telling it, and it understands regardless of the name, that for each $item in $mytextfile , do {thing }