So the goal is this.
We query an XML for data - and get something like yyyy-MM-dd.XXXX as a return from the element attribute we hit. (Already working.)
We then plug that into a $ReportURLdate variable, and visit https://www.IP.address/URLGibberish&File=$ReportURLdate using CURL.
This works fine when we return one value for $ReportURLdate, but sometimes we get the below when we return it.
yyyy-MM-dd.XXX1
yyyy-MM-dd.XXX2
And so on. (There could be 4-5 results for a single “Day”.)
How would I go about putting each of these results into their own variable, and then hitting the URL for each variable?
Could I dump them to a table and create a variable for each line with data?
I’m trying to use something like this, but it just isn’t working. (We are specifically looking for a string in this file with YESTERDAY’S date. It will have a random three number string on the end, like so.
“2019-06-10.123”
$Date = Get-Date $Date2 = $Date.adddays(-1).tostring("yyyy-MM-dd") $reportdate = "$date2.*"
Later on, we try to define $ReportURLdate
$ReportURLDay = Get-Content ./dates.txt | Where-Object { $_.Contains("$reportdate")}
This returns a null value.
I’m at my limits here with my skillsets.
I tried using regex, but it’s telling me there’s no overload for argument count.
If I could get a simple \d{3} regex working on this, I’d be closer to where I need to be with storing out the variables.
Any ideas?