For a check i need yesterday\'s date at 10:00pm in a variable.
I get yesterdays Date and current Time with
$a = (get-date).AddDays(-1)
(Get-Date (Get-Date -Format d)).AddHours(-2)