Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

replace string in multiple fils

$
0
0
Hi Sir,

Please:
I have to find and to replace "SkyDrive" or similairy
to "Onedrive" in all scripte fils..

Thanks for you Help.

My beste Regards,

Arnold
===========================

# Not work
cls

$includes = "C:\MMC\*.ps1"
$find = "SkyDrive" # or similairy
$replace = "OneDrive"

function Replace-String($find, $replace, $includes)
 {
 get-childitem $includes | select-string $find -list |% { (get-content $_.LiteralPath) |% { $_ -replace $find, $replace } | set-content $_.LiteralPath }
 }
 
 
 Replace-String


Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images