0

I want to replace /sites/contoso RelativeURL with /teams/Int_Contoso using PowerShell. Is there any regular expression to achieve this as we have changed the destination URLs during migration and now we want to compare source and destination list item counts for which we have to compare their server relative URLs.

0

You can use a simple -replace function of Powershell to achieve this. If there are more than one item you can use this replace in a loop

An illustration of replace function

$originalText = "/sites/contoso"
$newText = $originalText -replace 'sites','teams'

Value of $newText will be /teams/contoso

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.