stuck-order-import-tool
Helps operations staff quickly locate and gather multiple order XML files that are stuck or missing by entering order numbers. It scans a folder for matching files, shows which orders were found or not, and safely copies the needed files to a chosen output folder to speed up issue resolution. This removes the hassle of manually searching through files and reduces errors when handling order data.
Orders Import Tool
A Windows PowerShell GUI application for finding and copying order XML files based on order numbers.
Overview
The Orders Import Tool provides a user-friendly interface to:
- Paste a list of order numbers to search for
- Scan a folder containing XML files for matching orders
- Copy matched order files to a specified output folder
- View results with color-coded feedback (found, not found)
Features
- GUI Interface: Simple Windows Forms-based UI for easy interaction
- Batch Processing: Find and copy multiple orders at once
- Persistent Configuration: Automatically saves selected source and destination folders
- Visual Feedback: Color-coded results display (green for found, red for not found, amber for warnings)
- Order Number Normalization: Automatically adds
#prefix if missing - Duplicate Handling: Removes duplicate order numbers from search
- Safe Copying: Confirmation dialog before copying files to prevent accidental overwrites
Requirements
- Windows operating system
- PowerShell 5.0 or higher
.NET Framework(forSystem.Windows.Forms)
Installation
- Clone or download this repository
- Place
OrdersImportTool.ps1in your desired directory - Run the script:
powershell -ExecutionPolicy Bypass -File .\OrdersImportTool.ps1
Usage
- Launch the application: Run the script with PowerShell
- Enter order numbers: Paste order numbers in the text box (one per line). The
#prefix is optional - Select source folder: Click "Browse..." next to "Source folder" and select the folder containing XML files
- Specify output folder: Click "Browse..." next to "Output subfolder" and select where copied files should go
- Find and copy: Click the "Find and Copy" button to search for matching orders and copy them
- Review results: The results panel shows which orders were found and which weren't
- Confirm copy: A dialog will ask for confirmation before copying matched files
Buttons
- Find and Copy (blue): Searches for order numbers in XML files and copies matched files to the output folder
- Open Folder (gray): Opens the output folder in Windows Explorer for quick access to copied files
- Delete .cmp Files (red): Removes all
.cmpfiles from the output folder with confirmation
Configuration
The tool automatically saves your folder selections to OrdersImportTool.config.json (not tracked in git). This file stores:
SourceFolder: Path to the XML files directoryOutputFolder: Path to the output directory
Configuration is updated whenever you change folder paths using the GUI.
How It Works
- Reads all XML files from the source folder
- Extracts the
<ASSOCIATED_REF>tag from each XML file - Matches extracted references against the provided order numbers
- Reports matches and non-matches with color-coded feedback
- Copies matched XML files to the output folder upon user confirmation
File Structure
stuck-order-import-tool/
├── OrdersImportTool.ps1 # Main script
├── OrdersImportTool.config.json # Configuration (auto-generated, ignored by git)
├── .gitignore # Git ignore rules
└── README.md # This file
Limitations
- Only searches for XML files in the specified source folder (not recursive)
- Requires
<ASSOCIATED_REF>tag in XML files for order matching - Windows-only (uses PowerShell Forms and Windows APIs)