I\'m not such a regex expert and frankly I\'m trying to avoid it whenever I can.
regex
I would like to create a new $String where the number wit
$String
If you want to avoid the regex:
$String = "\\Server\c$\share_1\share2_\Taget2[1] - 2014-07-29.log" $parts = $string.Split('[]') $Newstring = '{0}[{1}]{2}' -f $parts[0],(1 + $parts[1]),$parts[2] $Newstring \\Server\c$\share_1\share2_\Taget2[2] - 2014-07-29.log