Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Row Count parameter in powershell

$
0
0

I am not a powershell expert so please help!

I have a script which counts rows in the .csv file, I want to add "2 additional counts" to my row count for header & footer eg if the row count is 10 it should print 12 (10 + 2). I tried to add @($csv).count+2 but it didn't work. Any ideas how I can do that.

Below is the script -

$csv = import-csv E:\BBUser.csv
"{0}|{1}" -f "***FileFooter", @($csv).count | Out-File -append E:\BBUser.csv

Thanks in advance. Please let me know if you need additional information


TechNet


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>