Wednesday, April 23, 2014

TFS Powershell Script Deploy *.RPT mods


[string] $outputFile="C:\DeployedChangeSet\DeployedChangeSetLog.txt"
[bool] $OpenOutputFile = $true;
[string] $DestFile="C:\DeployedChangeSet\Scripts"
[string] $filepath= "C:/MobileWebsite_Root/Main"

$items=Get-TfsItemHistory "$/MobileWebsite/Main/" -Version "D01/02/2013~" -Server tfs01 -Recurse -includeItems|

Select-Object -Expand "Changes"|Select-TFSItem

Select ChangesetId,TFSItem   -exp WorkItems |
    Format-Table Id,Title -GroupBy ChangesetId -Auto

foreach($item in $items)
{

    $itemPath=$item.Path.Trim()
    $extension = [System.IO.Path]::GetExtension($itemPath) 
    Remove-Item $DestFile\* -recurse
   if($extension -eq ".rpt")
    {
    
     $test = $itemPath.substring($itemPath.lastIndexOf("/Reports/"))
     $fp= $filepath + $test
     Copy-item $fp $DestFile -Recurse -force |out-file "C:\DeployedChangeSet\Scripts\Error.txt"
     
    }
   
    Write-Host "**********Code for services*****"
    if($itempath -contains )
}

No comments:

Post a Comment