Check if filename (string) starts with a number or symbol
<p>I have a large collection of files (.mp3's) that I'm trying to find duplicates of.</p>

<p>The problem I have now is that the filenames can look like below:</p>

<pre><code>Singer - Song
_1_Singer_-_Song_
001-Singer-Song
</code></pre>

<p>What I need to do is: </p>

<pre><code>If the name starts with a number (123456789) or a symbol (?=/&amp;%¤#"!_.-).
Then delete all numbers/symbols until there is an alphabetic character.
</code></pre>

<p>The filenames above should then (hopefully) look like this:</p>

<pre><code>Singer - Song
Singer_-_Song_
Singer-Song
</code></pre>

<p>This is what I have so far but I only need to replace the first characters of the name. They can vary from 0-10 characters so I somehow need to check how many characters that needs to be replaced in every file.</p>

<pre><code>$allNames = (Get-ChildItem D:\test)
Foreach ($name in $allNames)
{
    $name | Rename-Item -NewName {$name.Name -replace "_"," "}
}
</code></pre>

<p>Thanks</p>