Trying to Retrieve IIS Logs Sizes.

From time to time our IIS logs will fill up and have used multiple gigs of space. I am trying to create a powershell command or script that will check them for us once we run it. When running the command bellow the textfile has 3 computers in it right now. Instead of grabbing each files location it totals all of them up instead. How would I go about in having powershell display each of the computer location. For example PCA has this much storage in the location and PCB has this much right now it is PCA and PCB both together have this much. This is what I am using bellow.

 

(gci C:\Users\jpederson\Desktop\IISLogs.txt | measure Length -s).Sum /1gb

There is really not enough to go on here, thus leaving us to guess.

If you have multiple hosts, then you must iterate / loop over them and run any code during that loop that you’d want to gather.
If you are saying that all the data is in that one text file, then you’ll still need to loop through the lines to separate and calculate what you are after.

You need to show us the input and the expected output samples, or it’s really not possible to be definitive in a response.

The results you are getting is because that is all you are asking for.