Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DropBox -> OneDrive file name validation test
$srcPath = 'C:\..\dropbox-location'
$targetPath = 'D:\..\OneDrive-Location
$items = Get-ChildItem -Path $srcPath -Recurse
$regex = [regex] '[^\p{IsBasicLatin}]|[#%()]|^\s|\s$'
$items | %{
if($regex.IsMatch($_.Name)) {
Write-Host -fore red $_.FullName
}
}
#later execute:
#robocopy /E "$srcPath" "$targetPath"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.