I need a Powershell script that can access a file's properties and discover the LastWriteTime property and compare it with the current date and return the date difference.
I have something like this...
$writedate = Get-ItemProperty -Path $source -Name lastwritetime
...but I can not cast the lastwritetime to a "DateTime" datatype. It says, "Cannot concert "@{lastwritetime=...date...}" to "System.DateTime".
Any help would be highly appreciated!
Thanks to everyone in advance.