I have a body of a web request in powershell like the following
$body = "timePeriod":{"from":"2024-07-01T00:00:00+00:00","to":"2024-07-31T23:59:59+00:00"}}
How can i get the current month and the number of days in the month into some sort of variable and replace the dates in the body string with those variables .
So i get something like
$body = "timePeriod":{"from":$startDate,"to":$endDate}}
But the date must be of that format , ie “2024-07-01T00:00:00+00:00”
I dont know exactly how to start to put a variable in there. Do i need to just concat to the string ?
How can i do this ?