title: Split and add text/number to the filename
body: <p>I have been trying to write a script to remove end part of the filename and replace it with a version number of a build. I have tried trim and split but because of extra dots and not good with regex, im having problems.</p>
  
  <p>These are file examples:</p>
  
  <pre><code>Filename.Api.sow.0.1.1856.nupkg
  something.Customer.Web.0.1.1736.nupkg
  </code></pre>
  
  <p>I want to remove <code>0.1.18xx</code> from these filenames and add a build number from variable. which would be something like <code>1.0.1234.1233</code> (major.minor.build.revision)</p>
  
  <p>so the end result should be:</p>
  
  <pre><code>Filename.Api.sow.1.0.1234.1233.nupkg
  something.Customer.Web.1.0.112.342.nupkg
  </code></pre>
  
  <p>Here is my try to split and then rename. But it doesnt work.</p>
  
  <pre><code>$files = Get-ChildItem -Recurse | where {! $_.PSIsContainer}
  foreach ($file in $files)
  {
  $name,$version = $file.Name.Split('[0-9]',2)
  Rename-Item -NewName "$name$version" "$name".$myvariableforbuild
  }
  </code></pre>