Hi,
I am working on a powershell script which will run every hour (Task Scheduler). The script needs to copy a file and the new file will have a Date and the hour on the file name.
I believe I need to use the Get-Date cmdlet, however I need to only check the hour field.
File 1: C:\Data.txt
File 2: C:\Data_Date_Hr.txt
At the end of the day, I am expecting to see 24 files.
C:\Data_20150623_00.txt
-------------------------------
C:\Data_20150623_23.txt
Any help will be greatly appreciated.