• thanks for the reply. I'll take a look at that broader solution for that snippet. I actually got it working by saving my outgoing data into a variable, importing the contents of the csv file into another variable and appending the two together. My powershell scripting is quite novice so if you see any issues with this let me know 🙂

    Here is the code I used:

    $Temp = Get-SqlData $srcServer 'master' $qry

    $Last = import-csv "C:\filename.csv"

    $out = $Temp + $Last | export-csv -noTypeInformation -path "C:\filename.csv"