I have a remote machine running on UTC time. I need to use Get-Children to retrieve file properties. My script runs fine, but the LastWritetime is returned with the time being +6 hours (UTC time) - not the actual LastWritetime which is real file property. For example: File property 9/20/2004 9:06 PM PS returns 9/21/2004 3:06 AM — thus the +6 hours
There are various ways to convert the time. This should work for you though. It’s using a calculated property so we can make the conversion at the same time we select the object:
before we proceed … When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.