troubleshooting Question

Powershell array 2 questions

Avatar of tdodd72
tdodd72 asked on
Powershell
10 Comments1 Solution843 ViewsLast Modified:
Greetings I have this script and many thanks to those who helped. I have two things I would like to accomplish. I have multiple fileshares for EX: \\fileshare\share1 \\fileshare\share2 \\fileshare\share3. I am confused as to who I would incorporate this in my script. It would be time consuming to hard code this every time I run this.


Does anyone have a tutorial on data being put in an excel sheet. I would like to learn this but hte examples I am seeing are either too basic or advance and do not provide enough info.

"*.txt","*.log", "*.mp3", "*.avi", "*.rar" | foreach {
$( $Files = Get-ChildItem "\\fileshare\share" -Recurse -Filter $_
$Files | %{ "$($_.FullName) - $($_.Length/1Kb)Kb" } >> c:\temp\log.dat
""
"Total Number of Files: $(([Array]$Files).Count)"
"Total Size: $(($Files | Measure-Object -Sum Length).Sum/1Gb)Gb" )
}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros