none
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 web.services but nothing working

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

    $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?


    --- Thanks & Regards, Guhan

    Thursday, February 4, 2016 12:06 PM

Answers

All replies