This PowerShell suite facilitates the processing of CSV files based on a configurable set of parameters defined in a JSON configuration file. It is designed to be modular, with each script serving a specific purpose in the workflow.
The configuration file contains essential parameters for the operation of the scripts, such as the name of the CSV file to be processed and the keys used for searching and displaying data.
Example config.json content:
{
"csvName": "data.csv",
"key": "ColumnName",
"value": "ColumnValue",
"searchValue": "SearchTerm"
}The main script that orchestrates the execution of the other scripts, managing the flow and passing parameters between them. Key functionalities:
- Loads the configuration from
config.json. - Loads CSV data from the specified file.
- Allows setting or selecting key/value variables.
- Updates the configuration file with newly selected values.
- Retrieves and displays the value based on the key and search value.
Loads the configuration settings from config.json.
Loads data from the CSV file specified in the configuration.
Interactively selects or determines the key/value variables based on user input or predefined logic.
Updates the configuration file with new values as chosen or determined during the execution flow.
Extracts and displays values from the CSV data based on the configuration's key and search value.
- Set up your configuration in
config.jsonaccording to your CSV file and desired search parameters. - Run
Main.ps1to execute the suite. This script will sequentially call the other scripts to process the CSV data as configured.
# Example command to run Main.ps1
.\Main.ps1- Follow any on-screen prompts (if
SetVariable.ps1is set to require user interaction) to select keys and values for data processing.
- Ensure all scripts are located in the same directory, or adjust the paths in
Main.ps1accordingly. - Depending on your requirements for
SetVariable.ps1, you might need to customize this script to include specific logic for key/value selection. This suite assumes simplified user interaction and clear responsibilities assigned to each script for a streamlined experience in processing CSV data based on dynamic configuration.