如何列出文件夹中的文件并获取今天修改过的文件 [英] How to list files from a folder and get the files that got modified today

查看:77
本文介绍了如何列出文件夹中的文件并获取今天修改过的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我需要列出具有以下条件的某个文件夹的文件。

*如果是星期一,请检查今天修改过的5个文件。如果没有5个文件或者计数小于5,请发送一封关于文件丢失的电子邮件



星期二到星期五,查看今天修改过的4个文件。如果没有4个文件或者计数小于4,请发送一封关于文件丢失的电子邮件

Hello,
I need to list the files of a certain folder with the following conditions.
*If Monday, check for 5 files that got modified today. If there are not 5 files or if the counting is less than five, send an email about files missing

On Tuesday til Friday, check for 4 files that got modified today. If there are not 4 files or if the counting is less than four, send an email about files missing

$now = Get-Date
$strDate = "{0:yyyyMMdd}" -f ($now)
$folder = "\\up3\ftp\Backup"
If ($now.DayOfWeek -eq "Monday") {
   #Look for 5 files modified today
   #If 5 files modified today is true 
   # { All files found }
   #Else if there are no 5 files or are less than 5, send an email Files missing
}
 #Look for 4 files modified today
 #If 4 files modified today is true 
 # { All files found }
 #Else if there are no 4 files or are less than 4, send an email Files missing



感谢您的帮助,


Thanks for your help,

推荐答案

now = Get-Date
now = Get-Date


strDate ={0:yyyyMMdd} - f(
strDate = "{0:yyyyMMdd}" -f (


now)


这篇关于如何列出文件夹中的文件并获取今天修改过的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆