PowerShell Script: Convert To Local Time From UTC

I wrote this function in the script from my previous post “SCOM MP Authoring Example: Generate alerts based on entries from SQL Database (Part 2 of 2)”. It comes handy sometimes so I thought I’ll blog it separately as well. In PowerShell Datetime object, there is a ToUniversalTime() method that converts local time to UTC time. However, there isn’t a native way to convert FROM UTC To local time. So I wrote this function:

Continue reading
%d bloggers like this: