8,330 questions
Hi @ ChristopherJack-1763 ,
this is working here:
$DateTimeNow = (Get-Date).AddHours(-3) # the ".AddHours(-3)" is just for testing with different times, just remove this for your script
$DateTimeNow
if($DateTimeNow -gt "12:00 pm"){
Write-Output "later than 12:00 pm"
}
else {
Write-Output "before 12:00 pm"
}
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten