FileTransferFunctions.ps1 - lowfar/DataIntegrationForEcom GitHub Wiki

Synopsis

Contains the PowerShell Functions called during the Transfer Process. Functions include stripping of configuration files to get property values and execution of SQL Server commands

Author

Matthew Haigh, Database Administration Team - IT Operations

Functions

GetConfigProperty

Synopsis

Strips the Configuration File extracting property values.

Parameters

  • $path (String): File location of the Configuration file (.config).
  • $setting (String): Transfer or Process settings. Transfer settings include source and destination locations. Process settings control the ROBOCOPY process, log file settings, ProcessId and Option to prevent transfer process from running.
  • $property (string): The property value to extract

LogTransferProcess

Synopsis

Inserts a record in SQL Server Database table each time the Transfer Process is run by Executing a Stored Procedure.

Database Dependencies

Monitoring Solution

Parameters

  • $ProcessId (Int): ProcessId unique to a transfer process (source and destination)
  • $FileCount (Int): Number of files to be moved\copied by the process
  • $FileSize (Decimal): Combined size of the files to be moved
  • $FileSource (String): File location to which the process is using as the source
  • $FileDestination (String): File destination to which the process will copy files from the source
  • $Output (Int): Returns Stored Procedure OUTPUT parameter which represents the unique HistoryId

LogUpdateTransferEnd

Synopsis

Updates the record created by the Function: LogTransferProcess

Parameters

  • $HistoryId (Int): Unique HistoryId
  • $LogFile (String): Name and location of the ROBOCOPY log file