Auto-publishing published projects, but not with the version "working" RRS feed

  • Question

  • Hello, I need help to write a script. There is a script for auto-publishing projects on project server, but it is publishes all projects, even those that are not published on the project servers, ie projects with a version working, but not published, it is necessary that he published only with the version published on the project server . Thanks in advance.

    the script:

    # Set your variables
    $PWAUrl = “http://ServerName/PWA”
    # initiate the PSI Web Services
    #Project Web Service
    $ProjSvcURL = $PWAUrl + “/_vti_bin/PSI/Project.asmx?wsdl”
    $ProjSvcProxy = New-WebServiceProxy -uri $ProjSvcURL -useDefaultCredential #-credential $Credential
    #Queue web service
    $QSvcUrl = $pwaUrl + “/_vti_bin/PSI/QueueSystem.asmx?wsdl”
    $QSvcProxy = New-WebServiceProxy -uri $QSvcUrl -useDefaultCredential #-credential $Credential
    #Create Dataset & Fill with Project List
    $projDataSet = New-Object Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1_vti_bin_PSI_Project_asmx_wsdl.ProjectDataSet
    $projDataSet = $ProjSvcProxy.ReadProjectList()
    $PrjDS = $projDataSet.Project
    #CheckOut Project & Publish the Project#
    foreach ($p in $PrjDS)
    Write-host -ForegroundColor green  $p.PROJ_NAME “:: is being Checked Out for publishing” `
    $ProjSvcProxy.CheckOutProject($p.PROJ_UID, [System.Guid]::NewGuid(), “Checkout For AutoPublish via Powershell”);
    sleep 2
    Write-host -ForegroundColor red  $p.PROJ_NAME “:: Will be published now, you may check the queue” `
    $ProjSvcProxy.QueuePublish([System.Guid]::NewGuid(),$p.PROJ_UID, $true,”");
    sleep 2
    $ProjSvcProxy.QueueCheckInProject([System.Guid]::NewGuid(),$p.PROJ_UID,$true,[System.Guid]::NewGuid(),”Checkin Post Autopublish”);
    Write-host -ForegroundColor yellow  $p.PROJ_NAME “:: is being checked in now” `

    Monday, February 10, 2014 5:23 AM


All replies