Hi, I’m pretty new to powershell and was looking for some assistance
I would like a PowerShell script for log on script to do the following when a user logs on
Check if the following file exists
If it does then compare the modified date of the file with a copy on a server share
If the file on the server share is newer then replace the file
So I can test if the file exists with
Then I can check the last write time with
Get-Item C:\Users\$env:username\AppData\LocalLow\Sun\Java\Deployment\security\exception.sites | select LastWriteTime
I can also copy the file from the server with
Copy-Item "\\server01\share$\java_exceptions\exception.sites" "C:\Users\$env:username\AppData\LocalLow\Sun\Java\Deployment\security\"
I’m just not sure how to compare the files and string it all together.
Any help would be much appreciated