Repair-SharePointNames

1.0.1

Cleans up file and folder names that block a SharePoint Migration Tool
(SPMT) migration of Windows file shares to SharePoint Online. Feed it a
consolidated migration-warnings.csv exported from SPMT assessment scan
logs and it repairs every item SPMT flagged as INVALID_SHAREPOINT_NAME
under the root you specify. It never scans the filesystem on its own, so
only items S
Cleans up file and folder names that block a SharePoint Migration Tool
(SPMT) migration of Windows file shares to SharePoint Online. Feed it a
consolidated migration-warnings.csv exported from SPMT assessment scan
logs and it repairs every item SPMT flagged as INVALID_SHAREPOINT_NAME
under the root you specify. It never scans the filesystem on its own, so
only items SPMT actually flagged are touched.

Temp/system files (Office lock files, desktop.ini, InDesign lock files) are
moved to a quarantine folder, preserving their relative folder structure,
rather than deleted. All other flagged items are renamed, replacing
characters SharePoint Online does not allow (" * : < > ? / \ |) with '-'.

Entries are processed deepest-path-first so a flagged folder is never
renamed before the flagged items inside it are handled. If a cleaned name
collides with an existing item, a numeric suffix is appended, e.g.
"report (2).txt". Quarantine moves never overwrite: an existing quarantined
file at the same relative path also gets a numeric suffix. Every attempted
change is recorded in a transaction log CSV (see -LogPath), giving an
audit trail and a manual undo path.

Quick start:
 1. Run an SPMT assessment scan, export the scan logs, and consolidate
    the INVALID_SHAREPOINT_NAME rows into migration-warnings.csv.
 2. Preview: .\Repair-SharePointNames.ps1 -CsvPath .\migration-warnings.csv
    -RootPath \\server\share\HR -QuarantinePath C:\SPMigration\Quarantine -WhatIf
 3. Repair: the same command without -WhatIf, then re-run the SPMT scan
    to confirm the warnings are gone.

Full documentation, a sample warnings CSV, and the changelog:
https://github.com/TrogdorTheMan/Repair-SharePointNames

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Repair-SharePointNames

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 TrogdorTheMan. Licensed under GPL-3.0.

Package Details

Author(s)

  • TrogdorTheMan

Tags

SharePoint SPMT Migration FileShare Rename SharePointOnline Windows

Functions

Test-QuarantineTarget Split-BaseName Get-CleanName Get-UniqueDestination Write-ActionLog

Dependencies

This script has no dependencies.

Release Notes

1.0.1 - Expanded the description and release notes shown on the PowerShell Gallery; no functional changes.
1.0.0 - First stable release: native -WhatIf/-Confirm, transaction log, collision-safe renames and quarantine moves, 60-test Pester suite, CI on Windows PowerShell 5.1 and PowerShell 7.
Full changelog: https://github.com/TrogdorTheMan/Repair-SharePointNames/blob/main/CHANGELOG.md

FileList

Version History

Version Downloads Last updated
1.0.1 (current version) 6 7/6/2026
1.0.0 3 7/6/2026