Windows Vista Forums

writing performance data to csv file

  1. #1


    steve Guest

    writing performance data to csv file

    I have a script that copies several large files over the network and I want
    to track the performance, so I decided to use Measure-Command. How can I
    store all the results in a simple csv file with the file name so I can tell
    exactly how long each one took?





      My System SpecsSystem Spec

  2. #2


    Robert Robelo Guest

    RE: writing performance data to csv file

    You can create a custom object with two fields --Filename and Duration-- for
    each copied file and export the collection to a CSV file.

    $path = # <files' location>
    $dest = # <files' destination>
    Get-ChildItem $path | ForEach-Object {
    New-Object PSObject -Property @{
    File = $_.Fullname
    Duration = Measure-Command {Copy-Item $_.Fullname $dest}
    }
    } | Select-Object File, Duration | Export-Csv Perf.csv -NTI

    --
    Robert

      My System SpecsSystem Spec

writing performance data to csv file

Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing File to CD ROM SAC VB Script 9 16 May 2009
writing out to file Braden C. Roberson-Mailloux PowerShell 3 18 May 2008
KHz sample rate data and other key data fields missing from audio/media file properties view tophy Vista file management 4 14 Apr 2008
writing exif data Ralf Ziller Avalon 1 30 Nov 2006
Writing to a file with out-file or export-csv Marco Shaw PowerShell 1 07 Nov 2006