B18 Companion Assets — Sample Files Checklist ================================================ Each PowerShell script in this folder needs real test files in the target folders to run. Below is what you should prepare (file names are illustrative — pick names that match your parameters). ------------------------------------------------ Case A: Bulk Rename ------------------------------------------------ Source folder (e.g. C:\Test\Rename_Before) — 3 .xlsx files: SalesReport_01.xlsx SalesReport_02.xlsx SalesReport_03.xlsx After running: 2024Sales_01.xlsx 2024Sales_02.xlsx 2024Sales_03.xlsx Command: powershell -ExecutionPolicy Bypass -File .\案例A_批量重命名_en.ps1 ` -Folder "C:\Test\Rename_Before" -OldPart "SalesReport" -NewPart "2024Sales" -Apply Default is preview mode — add -Apply to actually rename. ------------------------------------------------ Case B: Word Find & Replace ------------------------------------------------ Source folder (e.g. C:\Test\Contracts) — 2-3 .docx files, each containing the phrase "Co., Ltd.": ACME_Co_Ltd_Contract_2024.docx ACME_Co_Ltd_Contract_2025.docx After running they become "ACME_Group_Co_Ltd_Contract_XXXX.docx". Command: powershell -ExecutionPolicy Bypass -File .\案例B_Word查找替换_en.ps1 ` -Folder "C:\Test\Contracts" -FindText "Co., Ltd." -ReplaceText "Group Co., Ltd." Note: this replaces ALL occurrences of "Co., Ltd." — check the docs first if the string could appear in places you don't want changed. ------------------------------------------------ Case C: Batch to PDF ------------------------------------------------ Word folder (e.g. C:\Test\Word) and Excel folder (e.g. C:\Test\Excel), each with 2-3 real .docx / .xlsx files. Word folder: WeeklyReport_2024W01.docx WeeklyReport_2024W02.docx Excel folder: MonthlyReport_2024M01.xlsx MonthlyReport_2024M02.xlsx Running the script writes same-name PDFs next to each source. Command: powershell -ExecutionPolicy Bypass -File .\案例C_批量转PDF_en.ps1 ` -WordFolder "C:\Test\Word" -ExcelFolder "C:\Test\Excel" ------------------------------------------------ Case D: Merge Word Docs ------------------------------------------------ Source folder (e.g. C:\Test\WeeklyReports) — 3-5 .docx files. Use zero-padded prefixes (01_, 02_, …) to keep sort order: 01_2024W01_Alice.docx 02_2024W02_Bob.docx 03_2024W03_Carol.docx Output file MUST live in a different folder (e.g. C:\Test\Merged\All.docx), otherwise a second run would embed the previous result into itself. Command: powershell -ExecutionPolicy Bypass -File .\案例D_合并Word_en.ps1 ` -SourceFolder "C:\Test\WeeklyReports" -OutputFile "C:\Test\Merged\All.docx" ------------------------------------------------ Generic: First time PowerShell blocks the script? ------------------------------------------------ If you see "cannot be loaded because running scripts is disabled", run once: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser Then re-run the commands above. This is the Windows default security policy: locally written .ps1 files are allowed; remote downloads need a signature. ================================================