Today I tried to export my project tasks as a csv file using PowerShell. I couldn’t find any helpful documentation on how to do this. A few articles that did almost what I wanted but just not the right thing.

Just a few lines and job done:

$svcProjectUrl = $applicationUrl + “/_vti_bin/PSI/Project.asmx?wsdl”

$svcProjectProxy = New-WebServiceProxy -uri $svcProjectUrl -useDefaultCredential

$project = $svcProjectProxy.ReadProjectList().Project

$project | Select Proj_name, Proj_UID, Proj_Type ` | Export-CSV .\$applicationName.csv -Delimiter “,”

if ($project.Proj_Name -ne $null)     {

Write-Host “Exporting”  $project.Proj_Name

$tasks = $svcProjectProxy.ReadProject($project.Proj_UID, 1).Task

$tasks | Select Task_name, Task_UID |  Export-CSV .\Tasks$applicationName.csv -Delimiter “,”

}

Advertisements