< Back

Save-ResultsToFiles

Mon Jan 13, 2020 2:32 am

NAME Save-ResultsToFiles



SYNOPSIS

Takes the $Results object and saves parts to csv files.





SYNTAX

Save-ResultsToFiles [-Results] <Object> [[-LogsDirectory] <String>] [[-SkippedFileName] <String>]

[[-ErrorFileName] <String>] [[-TimingFileName] <String>] [[-FileNamePrefix] <String>] [[-FileNameSuffix] <String>]

[<CommonParameters>]





DESCRIPTION

Create a Refund for each LineItem for the given order and Invoke-MktRefundLineItems.





PARAMETERS

-Results <Object>

The Results Object. It has 4 Components

success - array of success objects

skipped - array of failed objects

errors - array of error objects

timing - timing information for the operation



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-LogsDirectory <String>

Directory where the files will be written



Required? false

Position? 2

Default value ~/desktop/Logs

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SkippedFileName <String>



Required? false

Position? 3

Default value skipped

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-ErrorFileName <String>



Required? false

Position? 4

Default value errors

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TimingFileName <String>



Required? false

Position? 5

Default value timing

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-FileNamePrefix <String>



Required? false

Position? 6

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-FileNameSuffix <String>



Required? false

Position? 7

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

if (skipped) contents to $LogsDirectory"/skipped.csv";

if (errors) contents to $LogsDirectory"/errors.csv";

if (timming) contents to $LogsDirectory"/timing.txt";

returns $Results





NOTES





AUTHOR: Cyrus Jamula

LASTEDIT: March 16th, 2018



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$result = [PSCustomObject]@{



PSTypeName = 'PT.Result';

input = @();

success = @();

skipped = @();

errors = @();

timing = $null;

}

Save-ResultsToFiles -Results $result -LogDirectory "~/desktop/logs"











RELATED LINKS

Invoke-ScriptBlockOverArrays

Format-StatsFromResults