Skip to main content
Made the hierarchy clearer (moved the curly brackets around)
Source Link

Powershell to use Unix touch seems silly to me.

Instead, just use native Powershell cmdlets.

This article covers it:

Essentially:

Get-ChildItem -Path $youFolder -Recurse | Foreach-Object {
    if ($_.LastWriteTime -ge [DateTime] "1/31/2013 9:00AM")
    { 
        $_.LastWriteTime = Get-Date
    }
}

Should do the trick.

Powershell to use Unix touch seems silly to me.

Instead, just use native Powershell cmdlets.

This article covers it:

Essentially:

Get-ChildItem -Path $youFolder -Recurse | Foreach-Object {
if ($_.LastWriteTime -ge [DateTime] "1/31/2013 9:00AM")
{ 
  $_.LastWriteTime = Get-Date}
}

Should do the trick.

Powershell to use Unix touch seems silly to me.

Instead, just use native Powershell cmdlets.

This article covers it:

Essentially:

Get-ChildItem -Path $youFolder -Recurse | Foreach-Object {
    if ($_.LastWriteTime -ge [DateTime] "1/31/2013 9:00AM")
    { 
        $_.LastWriteTime = Get-Date
    }
}

Should do the trick.

added 83 characters in body
Source Link
Austin T French
  • 10.6k
  • 29
  • 42

Powershell to use Unix touch seems silly to me.

Instead, just use native Powershell cmdlets.

This article covers it:

Essentially:

Get-ChildItem -Path $youFolder -Recurse | Foreach-Object {
if ($_.LastAccessTimeLastWriteTime -ge [DateTime] "1/31/2013 9:00AM")
{ 
  $_.LastWriteTime = Get-Date}
}

Should do the trick.

Powershell to use Unix touch seems silly to me.

Instead, just use native Powershell cmdlets.

This article covers it:

Essentially:

Get-ChildItem -Path $youFolder -Recurse | Foreach-Object {$_.LastAccessTime = Get-Date}

Should do the trick.

Powershell to use Unix touch seems silly to me.

Instead, just use native Powershell cmdlets.

This article covers it:

Essentially:

Get-ChildItem -Path $youFolder -Recurse | Foreach-Object {
if ($_.LastWriteTime -ge [DateTime] "1/31/2013 9:00AM")
{ 
  $_.LastWriteTime = Get-Date}
}

Should do the trick.

Source Link
Austin T French
  • 10.6k
  • 29
  • 42

Powershell to use Unix touch seems silly to me.

Instead, just use native Powershell cmdlets.

This article covers it:

Essentially:

Get-ChildItem -Path $youFolder -Recurse | Foreach-Object {$_.LastAccessTime = Get-Date}

Should do the trick.