Powershell Swiss Army Knife
Author: zfive5 (zidong)
Email: zfive5@163.com
Introduction
The project team is relatively large, so some standards are always violated. It takes time and effort to discover their existence only after testing. Therefore, I have been trying to solve this problem and have already completed it on the metadata layer, now it has basically been implemented, but we only need to maintain the check library. We have checked the JS, CSS, and HTML specifications. We also wanted to let him implement it. The background is subject to time issues, directly use powershell to implement one. This is inspired by another employee who has left the company.
Body
Scripting cannot be used in JS applications due to future browser applications. fileSystemObject component. Therefore, it is mainly used to find the place where it is used, and then replaced it with other solutions.
The powershell solution code is as follows:
$ Filelist = Get-childitem-path "C: \ website \"-include "*. JS ","*. aspx ","*. htm ","*. html "-recurse
Foreach ($ file in $ filelist)
{
Select-string-pattern 'scripting. FileSystemObject '-path $ file | formatlist path, line, linenumber
}
Haha, you should learn it well. The world is simple.