I needed to change the date/timestamp on a file, and found that the touch utility does not exist. I also could not find the XP resource kit download, which apparently contains it. Then I remembered that PowerShell was installed when I recently installed SQL Server Express 2008.
Here is how to change the timestamp of test.txt in the current directory to 31/08/2012 with PowerShell:
$(get-item test.txt).lastwritetime=$(get-date "08/31/2012")
You can find more info here.
0 Responses to "My first foray into PowerShell":
Post a Comment