Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powershell output to excel in MB/GB form

Status
Not open for further replies.

tuttut

Technical User
Sep 15, 2010
3
US
Hey guys I have a question and excuse me as I am new to powershell. I have this script here and it basically calculates the total size on a share that a user utilizes. What I would like to do is two things. Place the output in an excel spreadsheet where in one column it displays the users name and the next it displays the value which is the total count. I have tried this with the export csv option but in all attempts have failed to produce this output.


My second question has to deal with the way the output is displayed. If a number falls into a MB then display it in MB and if it is in GB display this in GB.I would appreciate your assistance and the script is below.


$TotalCount = @{}
Get-ChildItem -Recurse \\servername\share | foreach {
$objOwner = (Get-ACL $_.FullName).Owner
$Totalcount[$objOwner] += $_.Length
}
$TotalCount
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top