Before running an AI rename script, preview the old and new names.
Check the target folder, name collisions and literal paths on disposable copies. A dry run shows proposed work; it does not prove the rule matches your intent.
Ask the AI for a two-column old-name/new-name plan before a batch rename. Check that every input has one intended output and that different files do not collapse to the same destination name.
Find collisions before running the plan
Our invented plan maps report-01.txt and report-02.txt to report.txt. That loses the distinction between two files. Keep the number, choose another naming rule or exclude those entries before proceeding.
Preview a single PowerShell change
For a disposable file in the current folder, our example is: Rename-Item -LiteralPath './sample [1].txt' -NewName 'sample-01.txt' -WhatIf. Microsoft documents WhatIf as showing the proposed operation without running it. LiteralPath treats brackets literally rather than as wildcard syntax.
Keep the preview’s limits clear
A preview cannot decide whether the naming rule is useful or whether the directory is the one you intended. Microsoft also notes that Rename-Item does not replace an existing destination item. Do not turn a collision into a forced overwrite workaround.
Try a copy and check the result
Our test first kept the original name and bytes after WhatIf, then renamed one disposable fixture and checked that its bytes were preserved. For your own task, inspect both the resulting names and the expected file count before applying a batch to originals.
Published October 14, 2026. WhatIf and one real rename were tested only on our own fixture; a two-name collision was checked as a plan. No AI-generated script or user document batch was executed.
Sources: Microsoft Learn · Rename-Item.