Reputation: 1
Get-ChildItem -Path '\\folder_path\' -Recurse |
Foreach-Object {
(Get-Item $_.FullName).LastWriteTime=$(Get-Date -format o)
}
Upvotes: 0
Views: 32
Reputation: 8442
Your code is only updating the property in-memory. To change the actual file on disk, you'll need to use Set-ItemProperty
. For example:
Set-ItemProperty -Path $_.FullName -Name LastWriteTime -Value (Get-Date)
Upvotes: 1