Write a powershell command that will change the modify, access, and create times of a file.
Write a powershell command that will change the modify, access, and create times of a file.
1 | Set-ItemProperty -Path "C:\path\to\file.txt" -Name LastWriteTime -Value "2023-03-08 12:00:00" -Name LastAccessTime -Value "2023-03-07 11:00:00" -Name CreationTime -Value "2023-03-06 10:00:00" |
Testing if the previous output contains the string .LastWriteTime
: False
Testing if the previous output contains the string .LastAccessTime
: False
Testing if the previous output contains the string .CreationTime
: False
Write a powershell command that will change the modify, access, and create times of a file.
Write a powershell command that will change the modify, access, and create times of a file.
1 | Set-ItemProperty -Path "C:\path\to\file.txt" -Name lastwritetime -Value (Get-Date).AddDays(-7) -Name lastaccesstime -Value (Get-Date).AddMonths(-3) -Name creationtime -Value (Get-Date).AddYears(-1) |
Testing if the previous output contains the string .LastWriteTime
: False
Testing if the previous output contains the string .LastAccessTime
: False
Testing if the previous output contains the string .CreationTime
: False
Write a powershell command that will change the modify, access, and create times of a file.
Write a powershell command that will change the modify, access, and create times of a file.
1 | Set-ItemProperty -Path "C:\path\to\file.txt" -Name LastWriteTime,CreationTime,LastAccessTime -Value (get-date) |
Testing if the previous output contains the string .LastWriteTime
: False
Testing if the previous output contains the string .LastAccessTime
: False
Testing if the previous output contains the string .CreationTime
: False
Write a powershell command that will change the modify, access, and create times of a file.
Write a powershell command that will change the modify, access, and create times of a file.
1 2 3 | Set-ItemProperty -Path "C:\Path\To\File.txt" -Name LastWriteTime -Value (Get-Date -Format "yyyy-MM-dd HH:mm:ss") -ErrorAction SilentlyContinue -Confirm:$false Set-ItemProperty -Path "C:\Path\To\File.txt" -Name LastAccessTime -Value (Get-Date -Format "yyyy-MM-dd HH:mm:ss") -ErrorAction SilentlyContinue -Confirm:$false Set-ItemProperty -Path "C:\Path\To\File.txt" -Name CreationTime -Value (Get-Date -Format "yyyy-MM-dd HH:mm:ss") -ErrorAction SilentlyContinue -Confirm:$false |
Testing if the previous output contains the string .LastWriteTime
: False
Testing if the previous output contains the string .LastAccessTime
: False
Testing if the previous output contains the string .CreationTime
: False
Write a powershell command that will change the modify, access, and create times of a file.
Write a powershell command that will change the modify, access, and create times of a file.
1 2 3 | Set-ItemProperty -Path "C:\path\to\file.txt" -Name "LastWriteTime" -Value (Get-Date) -Name "LastAccessTime" -Value (Get-Date) -Name "CreationTime" -Value (Get-Date) |
Testing if the previous output contains the string .LastWriteTime
: False
Testing if the previous output contains the string .LastAccessTime
: False
Testing if the previous output contains the string .CreationTime
: False