C
Cwheatley
Guest
I am trying to create a powershell script that will look at a list of file paths in a .txt file and output the file size. Here is what I have so far, but I am not getting anything exported into the .csv file. The file size does appear on the powershell screen though.
foreach($file in Get-content c:\scripts\folderlist.txt)
{# get size})
write-Host((Get-Item $file).length/1GB)|Export-csv -notypeinformation -path C:\scripts\PSTsize.csv
Output on screen:
PS C:\Users\wheatc02> foreach($file in Get-content c:\scripts\folderlist.txt)
>> {# get size})
>> write-Host((Get-Item $file).length/1GB)|Export-csv -notypeinformation -path C:\scripts\PSTsize.csv}
>>
5.69544315338135
0.000252723693847656
4.94664859771729
0.161789894104004
0.000252723693847656
0.000252723693847656
8.10762119293213
0.0250864028930664
0.482499122619629
1.72820377349854
0.177872657775879
0.000252723693847656
0.000252723693847656
0.00214481353759766
0.00143527984619141
0.0352563858032227
0.017281532287597
Any help would be appreciated.
Continue reading...
foreach($file in Get-content c:\scripts\folderlist.txt)
{# get size})
write-Host((Get-Item $file).length/1GB)|Export-csv -notypeinformation -path C:\scripts\PSTsize.csv
Output on screen:
PS C:\Users\wheatc02> foreach($file in Get-content c:\scripts\folderlist.txt)
>> {# get size})
>> write-Host((Get-Item $file).length/1GB)|Export-csv -notypeinformation -path C:\scripts\PSTsize.csv}
>>
5.69544315338135
0.000252723693847656
4.94664859771729
0.161789894104004
0.000252723693847656
0.000252723693847656
8.10762119293213
0.0250864028930664
0.482499122619629
1.72820377349854
0.177872657775879
0.000252723693847656
0.000252723693847656
0.00214481353759766
0.00143527984619141
0.0352563858032227
0.017281532287597
Any help would be appreciated.
Continue reading...