locked
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

  • Might try them over here.

    https://social.msdn.microsoft.com/forums/en-us/home?forum=projectserver2010general

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    • Proposed as answer by Mike Laughlin Thursday, February 4, 2016 1:47 PM
    • Marked as answer by Just Karl Thursday, February 11, 2016 5:17 PM
    Thursday, February 4, 2016 1:43 PM
  • Hi,

    Thanks. Have posted there.


    --- Thanks & Regards, Guhan

    Thursday, February 4, 2016 3:21 PM
  • You're welcome.

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Thursday, February 4, 2016 3:59 PM