ProjectWise URL

Hi,

Is there any cmdlet available to generate the ProjectWise Documents URL in bulk or in batch.

Thank you!

Regards,

Amol Sonawane

Parents
  • Which URL are you looking for? The one that you get when you right-click the address bar and select Copy URL or Copy URN, or the one when you right-click a file and pick Get Link..

    You can get a URN link from the first method by using Get-PWDocumentsBySearch with the -slow option. It's the DocumentURN property

    $pwDocs = Get-PWDocumentsBySearch -Folder 'path\to\files' -Slow

    $pwDocs | Select FileName, DocumentURN

    the -slow option really is slow, if you want to build your own URN without needing that

    $pwServer = Get-PWCurrentDatasource
    $pwDocs = Get-PWDocumentsBySearch -Folder 'path\to\files'
    $URNs = @()
    ForEach ($d in $pwDocs) {
        $URNs += "pw://$($pwServer)/Documents/D{$($d.DocumentGUIDString)}"
    }
    $URNs

    You can build a URN to a folder using the code above by using Get-PWFolders and in the URN changing the D{ to a P{ and changing DocumentGUIDString to ProjectGUIDString

    I don't know of a way to programmatically get the Get Link... style of link. You can build older style URLs instead of URNs but you'll have to fetch the full path using -PopulatePath on the Get-PWDocumentsBySearch (which is slow) and you may also need to URL encode the results. The URN method is way easier.

     

Reply
  • Which URL are you looking for? The one that you get when you right-click the address bar and select Copy URL or Copy URN, or the one when you right-click a file and pick Get Link..

    You can get a URN link from the first method by using Get-PWDocumentsBySearch with the -slow option. It's the DocumentURN property

    $pwDocs = Get-PWDocumentsBySearch -Folder 'path\to\files' -Slow

    $pwDocs | Select FileName, DocumentURN

    the -slow option really is slow, if you want to build your own URN without needing that

    $pwServer = Get-PWCurrentDatasource
    $pwDocs = Get-PWDocumentsBySearch -Folder 'path\to\files'
    $URNs = @()
    ForEach ($d in $pwDocs) {
        $URNs += "pw://$($pwServer)/Documents/D{$($d.DocumentGUIDString)}"
    }
    $URNs

    You can build a URN to a folder using the code above by using Get-PWFolders and in the URN changing the D{ to a P{ and changing DocumentGUIDString to ProjectGUIDString

    I don't know of a way to programmatically get the Get Link... style of link. You can build older style URLs instead of URNs but you'll have to fetch the full path using -PopulatePath on the Get-PWDocumentsBySearch (which is slow) and you may also need to URL encode the results. The URN method is way easier.

     

Children