powershell 获取过期的文件

function funline($strin="hello")

{

$num=$strin.length

for($i=1;$i -le $num;$i++){$funline = $funline + "="}

Write-Host -ForegroundColor Yellow $strin

Write-Host -ForegroundColor DarkRed $funline

}

$folder="C:\Users\qliangliang.BOOK\Documents"

$date=get-date

$limit=3

$xfiles=$Null

Get-ChildItem -Path $folder -Force | ForEach-Object {

$newdate=($_.LastAccessTime).AddDays($limit)

$limitDate=New-TimeSpan -Start $date -End $newdate

if($limitDate -le 0)

{

[email protected]{$_.Name=$_.LastAccessTime}

}

}

funline("the expired files art listed below")

$xfiles

时间: 2024-08-26 11:42:44

powershell 获取过期的文件的相关文章

linux获取目录下文件

查看当前目录下的文件:find . -type f查看当前目录下的文件夹: find . -type d如果文件file1不为空: if [ -s file1 ];then       echo "file1 不为空"fi #!/bin/sh for f in `find ./testdir -type f`; do         if [ -s $f ];then                 echo $f is not empty.                 echo 

通过命令获取/etc/hosts文件的权限对应的数字

命令获取/etc/hosts文件的权限对应的数字 第一步 查看文件的权限 [[email protected] ~]# stat /etc/hosts File: `/etc/hosts' Size: 158         Blocks:8          IO Block: 4096   regular file Device: 803h/2051d   Inode: 915740      Links: 2 Access:(0644/-rw-r--r--)  Uid: (    0/  

php获取两个文件的相对路径

例如:文件A 的路径是 /home/web/lib/img/cache.php 文件B的路径是 /home/web/api/img/temp/show.php 那么,文件A相对于文件B的路径是 ../../lib/img/cache.php function getRelativePath($urla,$urlb){ /*******第一步:获取两个文件的相同路径并去掉*****/ //获取路径名 $a_dirname=dirname($urla);   //$a_dirname=/home/w

Android手机如何获取power_profile.xml文件

最近在做关于能耗方面的测试,看了一个月时间的论文,终于找到了一些新的思路,但是一个问题出现了,以至于 工作无法再进行下去. 在Android手机中,对于手机中的每个部件(cpu.led.gps.3g等等)运行时对应的能耗值都放power_profile.xml 文件中,而且系统的 设置-->电池-->使用情况中,统计的能耗的使用情况也是以power_profile.xml的value作为基础参数 的.Android手机如何获取power_profile.xml文件呢?接下来我们会详细介绍该问题

Perl获取目录下文件或者包含子目录下文件

1 my $dir = "D:\\My_Work\\Temp"; 2 my @files = (); 3 4 #获取给定目录下文件 5 @files = get_dir_files($dir); 6 7 #获取给定目录以及子目录下文件 8 @files = get_dir_files_x($dir); 9 10 #获取目录下以及子目录下文件,返回的结果中包含路径 11 sub get_dir_files_x{ 12 my ($dir_p) = @_; 13 my @files = ()

php 如何获取一个json文件

function showupversion(){ #获取平台类型 $type='android'; #读取文件的路径 $url="D:/WWW/gm_lequ/gm_lequ"; $file_name="update.ini"; $path=$url.'/'.$type.'/'.$file_name; #判断文件的路径是否存在 判断目录是否存在我们用is_dir就OK了. if(file_exists($path)){ #读取php.ini json格式的文件 $

通过PowerShell获取Windows系统密码Hash

当你拿到了系统控制权之后如何才能更长的时间内控制已经拿到这台机器呢?作为白帽子,已经在对手防线上撕开一个口子,如果你需要进一步扩大战果,你首先需要做的就是潜伏下来,收集更多的信息便于你判断,便于有更大的收获.用什么方法才能有尽可能高的权限,同时能更有效的隐藏自己,是留webshell,留后门,种木马还是Rootkit?webshell,哪怕是一句话木马都很容易被管理员清除,放了木马,也容易被有经验的管理员查出,不管是早期自己创建进程,进程被干掉就完了,还是注入进程的木马,或者是以服务自启动的木马

linux shell 脚本获取和替换文件中特定内容

1.从一串字符串中获取特定的信息 要求1:获取本机IP:menu.lst为系统镜象的IP配置文件,需要从中获取到本机IP信息(从文件获取信息) 1 timeout 1 2 default 0 3 4 title live 5 find --set-root /casper/vmlinuz 6 kernel /casper/vmlinuz boot=casper ignore_uuid showmounts ip=eth0,10.0.66.66,255.255.240.0,10.0.64.3 7

获取要下载文件的大小信息

原文来自IOS教程网,转载时请注明文章的来源:http://ios.662p.com/thread-1660-1-1.html NSURLConnectionDataDelegate方法中有: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {     //This method is calle