Hi all,
I want to write a powershell script that updates only part of a UNC path. The path may vary and the last directory in the unc always starts with the same name but has a different 3 letter code. For example:
\\server1\dir1\dir2\dir3\oldfolder-ABC
\\server2\dir6\oldfolder-DEF
So logically what I (think I) need to do is replace all of the text before and including "oldfolder_###" with the new UNC path
something like...
$newPath = $oldPath -replace ([regex]::Escape("*oldfolder-___")),"\\newserver\newfolder"
But that obviously doesn't work :) Can anyone help pls?
Many thanks