Reputation: 21
I am new to this. i have a folder test which contains many ".txt" files. I want to search a particular file (file_20131211_xxxxx.txt) and in the file, search for the word "exit:x" and mail it to a address as the exit value is x. please help me with this using power shell.
Upvotes: 0
Views: 52
Reputation: 68341
Powershell has very good help built in.
Open a fresh Powershell console, and run these commands and read through the output:
Get-Help Get-ChildItme -Full
This will help you find locate all the .txt files.
Get-Help Select-String -Full
This will help you locate the words "exit x" in those files.
Get-Help Send-MailMessage -full
This will help you send the email.
Upvotes: 2