Powershell Automation System has a collection of useful PowerShell modules and scripts. In Powershell.AutomationSystem, you can find mostly all the common functions for processing a XMLs files and transform into the SQL database. You can handle the whole process with the distinct to the Production and Stage database with either using of the DataTable or QueryStatements. Also, handle the logs files for the step by step process and adds the exception logs file when throws an any exception.
Please check below to the list of SQL modules overview and their usage.
Returns Database connection string either Production/Stage based on '$Stage' flag. Please click here to check parameter details.
Set the Connection string Globally of the Production and Staging and Get-ConnectionString function return the connection string. Please click here to check parameter details.
Open a new SQL Connection object based on the $Stage flag for the Stage or Production database. Please click here to check parameter details.
SQL Connection should be closed if no longer required. It will automatically handles and closed the current SQL connection when there is no longer needs. Please click here to check parameter details.
Execute the INSERT, UPDATE, DELETE Statement or Store procedure. You can execute either SQL query or Procedure based on the functions parameters. Please click here to check parameter details.
Execute the Query Statements or Stored procedure with parameter and returns a result. Please click here to check parameter details.
Insert the bulk data to SQL Server database tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable instance or read with IDataReader instance. Please click here to check parameter details.
Please check below to the list of Common modules overview and their usage.
Get Country code from the string. However, The string can be either Address Line or full country name. Please click here to check parameter details and examples.
Load the Default Settings of the System. Loading the Default Settings at the very begging of the system and can use the global settings to the whole system. Currently, Reading from the Config.json file. Where to mention all the resources, connections, and other configs. Please click here to check how to loads default configs and example for how to use configs.
Initialize the global objects. However, we are using those objects while processing the bunch of XMLs files in one go. So, Global objects holds the table data until the save and clear once bunch of data save. Please click here to check how to intialize globals and example for how to use them.
Used for the remove files or folders from Explorer. However remove items from either directly using file path, files which contain a list of file paths, directory, and Object which contains a list of the path. Please click here to check parameter details and examples.
Write the exception logs in the exception log file. When throws an exception in the system we are handling the write the exception message and stack trace in the exception log file. which is generating based on the current date. Please click here to check parameter details and examples.
Write the list of paths into the text file from the directory. However, Get all child items from directory either from subfolders and writes the file paths into the given file location. Please click here to check parameter details and examples.
Write the execution logs information into the log file. Write the step by step log information for the usage of tracking or keep as how the process goes on. We write the logs based on the needs and some messages only print in cmdlet to check the current status of the execution and important steps are written into the log file for later use. Please click here to check parameter details and examples.
Write the exact time of the execution process. However, When starting the process $Timer would start and stop when process execution is finished. Also, Can able to add into the logs file as well based on the $Write flag. Please click here to check parameter details and examples.
Please check below to the list of Helper modules overview and their usage.
Create a directory into the system. However, If given path directory does not exist into the system then create a new directory at given $Path. Please click here to check parameter details and examples.
Create a file into the system. However, If given path file does not exist into the system then create a new file at given $Path. Please click here to check parameter details and examples.
Convert the date-time string into the DateTime. However, Parse the date from the $String and $Format and return DateTime. Note that, return $null if $String or $Format is not valid. Please click here to check parameter details and examples.
Select the First record from the list of the object. Please click here to check parameter details and examples.
Select the Last record from the list of the object.. Please click here to check parameter details and examples.
Convert the DateTime into the string based on the $Date and $Format. Note that, return $null if $Date or $Format is not valid. Please click here to check parameter details and examples.
Substring based on the Start and Length value of any string. However, Handling the Substring $null value and also used with the Default length. So, overwhelmed the exception in any of the cases. Please click here to check parameter details and examples.
Get the valid type from the TypeName string. Please click here to check parameter details and examples.
Returns the date based format or default date format. $Format and other any of the. Please click here to check parameter details and examples.
Converts a Object list into the DataTable. Please click here to check parameter details and examples.
Returns a $null. Used for the assign $null value to any properties. Please click here to check parameter details and examples.
Returns a string or $null if empty. Please click here to check parameter details and examples.
Returns $Value or 0 if value is $null. Please click here to check parameter details and examples.
Returns a string with fixing the single quote or empty string converting $Value. Please click here to check parameter details and examples.
Returns $Value or '0' if $Value is null or empty. Please click here to check parameter details and examples.
Please check below to the list of Controllers modules overview and their usage.
A process on XML file for the inserting records in respective tables. However, Read the XML based on the nodes and calling the respective class and split the data into the class methods and assign it to the respective global table objects. Please click here to check parameter details and examples.
Call to Save data into the database to all Global objects here. Please click here to check parameter details and examples.
Public is the starting point of the processing on XMLs. Calling from the AutomationSystem.Tests.ps1
Call to Save data into the database to all Global objects here. Please click here to check parameter details and examples.
Config.json holds all the system settings in json format. Currently, Stored configuration such as resources, connections, and other configs
Loads all the modules before start the process
Call to Save data into the database to all Global objects here. Please click here to check how to execute and parameter details.
Uploads directory holds all the log informations of executions and exceptions.