Skip to content

Commit

Permalink
1.0.1 with proper fix
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Jun 21, 2019
1 parent 5f3c588 commit 7cf61b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions allcommands.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44979,9 +44979,9 @@ function Invoke-DbatoolsRenameHelper {
$file = $fileobject.FullName

foreach ($name in $allrenames.GetEnumerator()) {
if ((Select-String -Pattern $name.Key -Path $file)) {
if ((Select-String -Pattern "\b$($name.Key)\b" -Path $file)) {
if ($Pscmdlet.ShouldProcess($file, "Replacing $($name.Key) with $($name.Value)")) {
$content = (Get-Content -Path $file -Raw).Replace($name.Key, $name.Value).Trim()
$content = ((Get-Content -Path $file -Raw) -Replace "\b$($name.Key)\b", $name.Value).Trim()
Set-Content -Path $file -Encoding $Encoding -Value $content
[pscustomobject]@{
Path = $file
Expand Down
5 changes: 3 additions & 2 deletions functions/Invoke-DbatoolsRenameHelper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ function Invoke-DbatoolsRenameHelper {
'Get-DbaDistributor' = 'Get-DbaRepDistributor'
'Get-DbaInstance' = 'Connect-DbaInstance'
'Get-DbaJobCategory' = 'Get-DbaAgentJobCategory'
'Get-DbaLog' = 'Get-DbaErrorLog'
'Get-DbaLogShippingError' = 'Get-DbaDbLogShipError'
'Get-DbaOrphanUser' = 'Get-DbaDbOrphanUser'
'Get-DbaPolicy' = 'Get-DbaPbmPolicy'
Expand Down Expand Up @@ -308,9 +309,9 @@ function Invoke-DbatoolsRenameHelper {
$file = $fileobject.FullName

foreach ($name in $allrenames.GetEnumerator()) {
if ((Select-String -Pattern $name.Key -Path $file)) {
if ((Select-String -Pattern "\b$($name.Key)\b" -Path $file)) {
if ($Pscmdlet.ShouldProcess($file, "Replacing $($name.Key) with $($name.Value)")) {
$content = (Get-Content -Path $file -Raw).Replace($name.Key, $name.Value).Trim()
$content = ((Get-Content -Path $file -Raw) -Replace "\b$($name.Key)\b", $name.Value).Trim()
Set-Content -Path $file -Encoding $Encoding -Value $content
[pscustomobject]@{
Path = $file
Expand Down

0 comments on commit 7cf61b3

Please sign in to comment.