Answer the question
In order to leave comments, you need to log in
How to put down the date -1 day?
Good afternoon! There is a script for batch renaming files, but I can’t fasten it so that the date is set 1 day earlier than the current one, tell me how can I implement it?
example script I use
cd C:\
dir dir | rename-item -NewName {$_.name -replace "123","File 1 $(Get-Date -Format {dd.MM.yyyy})"}
Googled options on Microsoft but something doesn't start
–Date(" {0:dd/MM/yyyy}" -f (get-date).AddDays(-1))
$thedate = get-date -date $(get-date).adddays(-90) -format yyyy-MM- dd
$thedate
Thanks in advance
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question