Powershell and Project Server doubt(PSI) RRS feed

  • Question

  • All,

    I have created web service proxy in powershell and able to retrieve the list of projects from the project server. It was quick and easy. however To get details for individual project I need to call ReadProjectEntities(guid, project entity type, DataStore Enum) method

    I could pass Guid, flag but not sure how to refer and pass the Datastoreenum(which is C# Enum). I tried multiple things / code but I get different errors. I tried to import module for but nothing working

    $pwaUrl = “https://<server>/<project>”
    $pwaPSUrl_Projectasmx = "/_vti_bin/PSI/Project.asmx?wsdl"
    $svcPSUrl = $pwaUrl + $pwaPSUrl_Projectasmx

    $myCred = Get-Credential

    $svcPSProxy = New-WebServiceProxy -uri $svcPSUrl -credential $myCred
    echo "proxy created"

    [System.Enum]$pwaDataStoreEnum =  $svcPSProxy.DataStoreEnum # this not returning as enum.
    echo "Enum " $pwaDataStoreEnum.GetType() // this gives error.

    #equivalent method in ASPX page with C# code is below

    MyProjectWebReference.ProjectDataSet readProjDs = projectSvc.ReadProjectEntities(guid, PROJECT_ENTITY_TYPE_TASK_AND_RESOURCE, MyProjectWebReference.DataStoreEnum.WorkingStore);

    $pwaDataStoreEnum = [System.Xml.Serialization.XmlTextAttribute]::DataStoreEnum
    echo  "Data Store Enum" $pwaDataStoreEnum // This too return nothing

    Anyone have suggestions/thoughts? Have submitted the same question in Project server programming and customization forum as well.

    --- Thanks & Regards, Guhan

    Thursday, February 4, 2016 2:37 PM