Q: How can I get yesterday's date?
A: You can use a combination of the Get-Date cmdlet and .NET Time/Date methods.
First, let's look at dates in PowerShell and .NET Then we can look at how to calculate yesterday and use that in your scripts.
Dates in PowerShell
Let's start by looking at how you can deal with dates and times. As you ...