jeudi 11 février 2021

If (last modified date = ...?)

I am new to powershell and I am trying to make a script that goes a bit like this:

if (last modified date of the directory is in the last few minutes)

..then print this out

Right now I have

 "lastModifiedDate = (Get-Item "C:\Backups").LastWriteTime

 if ($lastModifiedDate = ) {
 write-output "The local backup is complete!"
 }

Not sure what I need to have inside the if? Happy for all the help and tips I can get!

Aucun commentaire:

Enregistrer un commentaire