Geeks With Blogs
kazim mehdi
$p4= "C:\Program Files\Perforce\p4.exe"

# need to be changed

$path="C:\dev\www"

$oldValue="((?<=\<td(.*))align\=""right"")"
$newValue="align=""left"""
# need to be changed

Write-Host "Searching for : $oldValue"
Write-Host "Replaced value: $newValue"


$count=0
dir $path -Recurse -Include *.aspx, *.ascx| ForEach-Object{
$text=Get-Content $_.FullName;
if ($text -match $oldValue)
{
&$p4 edit $_.FullName
$text=$text -replace $oldValue,$newValue
set-content $_.FullName -value $text

$count++
}
}

Write-Host "total files found:$count"

Set the correct path of the “$p4” variable to point to the correct Perforce exe.

Posted on Friday, April 1, 2011 3:38 PM Powershell | Back to top


Comments on this post: checkout multiple files from Perforce using powershell

# re: checkout multiple files from Perforce using powershell
Requesting Gravatar...
good post.. thanks..
Left by Cartier on Apr 08, 2012 5:48 AM

Your comment:
 (will show your gravatar)
 


Copyright © kazim sardar mehdi | Powered by: GeeksWithBlogs.net | Join free