@@ -122,9 +122,10 @@ function Rename-InProject {
122122 [IO.Directory ]::GetDirectories($dir , " *" ) | ForEach-Object {
123123
124124 if ([IO.Path ]::GetFileName($_ ) -notin @ (" .svn" , " .git" )) {
125- Get-ProjectFiles $_ $mask | ForEach-Object {
126- $result.Add ($_ )
127- } | Out-Null
125+ $null = Get-ProjectFiles $_ $mask | ForEach-Object {
126+
127+ $null = $result.Add ($_ )
128+ }
128129 }
129130 }
130131
@@ -151,8 +152,11 @@ function Rename-InProject {
151152
152153 if ($content -ne $newContent ) {
153154 if ($PSCmdlet.ShouldProcess ($filePath , " Replace content" )) {
155+
154156 $utf8 = [Text.UTF8Encoding ]::new($false )
157+
155158 [IO.File ]::WriteAllText($filePath , $newContent , $utf8 )
159+
156160 Write-Verbose " Updated content in: $filePath "
157161 }
158162 }
@@ -171,7 +175,7 @@ function Rename-InProject {
171175
172176 if ($PSCmdlet.ShouldProcess ($filePath , " Rename file" )) {
173177 try {
174- Move-ItemWithTracking - Path $filePath - Destination $newPath
178+ $null = Move-ItemWithTracking - Path $filePath - Destination $newPath
175179 Write-Verbose " Renamed file: $filePath -> $newPath "
176180 }
177181 catch {
@@ -204,12 +208,12 @@ function Rename-InProject {
204208 # merge directories if target exists
205209 Start-RoboCopy - Source $dir.FullName `
206210 - DestinationDirectory $newPath - Move
207- Remove-AllItems ($dir.FullName ) - DeleteFolder
211+ $null = Remove-AllItems ($dir.FullName ) - DeleteFolder
208212 Write-Verbose " Merged directory: $ ( $dir.FullName ) -> $newPath "
209213 }
210214 else {
211215 try {
212- Move-ItemWithTracking - Path $dir.FullName - Destination $newPath
216+ $null = Move-ItemWithTracking - Path $dir.FullName - Destination $newPath
213217 Write-Verbose " Renamed directory: $ ( $dir.FullName ) -> $newPath "
214218 }
215219 catch {
0 commit comments