Powershell traverses a folder under a disk

Source: Internet
Author: User

cd  "D:\symantec\scan engine\cmdlinescanner\" write-host  "start scanning for a file that starts with a!" Get-childitem -path z:\  | where {$_. name -match  "^a"} | select fullname  | out-file files.txt # Get files and folders starting with a, output to A.txt file $file = get-content  "files.txt"   #将files .txt  content to $file$file  -replace  "(? m) \s", ""  > files.txt  #删除a spaces in a. txt file $file = get-content   "Files.txt" $file  =  $file [3: $file. count] | out-file files.txt # Delete the first three lines of the file description information, the content of the output overwrites the contents of the A.txt file $file = get-content  "Files.txt" foreach  ($check  in  $file) {     $check  =  "" $check "" "  #给轮循的内容加上双引号     cmd   /c  ssecls.exe -server 127.0.0.1:1344 -mode scan -recurse  -api 1 -exclude exclude.lst -log a%date%.log  $check  >> a%date%-result.log    write-host  $check   "}write-host " scan completed with a head-up file! "


This article is from the "BOM water Year _" blog, please be sure to keep this source http://timefiles.blog.51cto.com/8475652/1855343

Powershell traverses a folder under a disk

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.