combine lines from multiple files into output file.

by Apr 8, 2016

As a PS noob, I need a lot of direction on this little project.

Most of what I don't understand is how I can import each of the separate reports, search for corresponding data in each, and then combine it for form an info txt file for EACH of the shares.

 Any directions you can point me in would be appreciated, especially including samples for me to run/learn from.

·        
Report 1: uses Get-Shareinfo cmdlet.   The script that uses this save a separate file
for each server queried. Each file is named <FQDN.Server>.csv

After each server is queried, the individual csv’s
are combined into a master csv. Csvfilestomerge.txt is the csv file list from
each system using Merge-CSVFiles
-CSVFiles (Get-Content c:tempcsvfilestomerge.txt) -OutputFile c:tempshareinfoOut.csv

The merged result (shareinfoOut.csv) contains data in this
format (single header row):

"

·        
Report 2: Dfsutil root export \site-it-fs.blah.comroot
dfsexport.xml downlevel (standalone
dfsn)

·        
Report 3: Get-Fsrmquota cmdlet

 
The text file I wish to create is in the format below
(filename to be “<sharename> Share Info.txt”)
DFSN Link : \site-it-fs.blah.comrootLabsfsorcad (from dfsn export….by match with Backend Server row & Names row from get-shareinfo export)
Server : LabsvmFS05.blah.com (from get-shareinfo export)
Quota : xxx GB 
Owner (email) : if possible, take this from get-shareinfo using description field or email notification admin field
Backup (email) : if possible, take this from get-shareinfo using description field or email notification admin field
Notifications : if possible, take this from get-shareinfo using description field or email notification admin field
Permissions-full: domain/user (from get-shareinfo export and accessmask row)
Permissions-read: domain/user  (from get-shareinfo export and accesmask row)
Date: <date this file created>
Notes : Description field from fsrmQuata + Description field from get-shareinfo