1. Create file like indicated in previous post with the numbers.
2. Create a file called SUMIT.PS1 (note extension):
2.1. Add the command (no quotes): "gc .\sumit.txt | measure-object -sum -max -min -ave"
3. Make sure the text file with numbers, and the "ps1" script are in the same folder.
4. Start powershell (this is only needed to be done once):
4.1. Enter the command (no quotes): "Set-ExecutionPolicy RemoteSigned"
4.2. Powershell doesn't allow scripts to be run by default. The above forces powershell to run scripts.
4.3. The above command is permanent, until you reset your computer (e.g. recovery partition or CD)
5. Exit powershell.
6. In your batch file:
6.1. CD to the location of the two above files.
6.2. Enter "powershell .\sumit.ps1" (no quotes) in the batch file.
-----> Begin just showing contents of files
gc .\sumit.txt | measure-object -sum -max -min -ave
-----> End just showing contents of files
Count : 4
Average : 50.25
Sum : 201
Maximum : 100
Minimum : 25
Best of luck!
Edited by scotty_ncc1701, 03 July 2014 - 09:42 PM.