Guest User

Untitled

a guest
Apr 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. # similar to `ls -R`
  2.  
  3. # authenticate
  4. $ishSession = New-IshSession -IshUserName $username -IshPassword $password -WsBaseUrl $url
  5.  
  6. # get a list of all DocumentObjs in the repository. Then cycle through that list to get folder locations.
  7.  
  8. echo "[DocumentObj]" | out-file -encoding ascii 'ls.txt'
  9. $requestedMetadata = Set-IshRequestedMetadataField -IshSession $ishSession -Name FTITLE -Level Logical
  10. $documentObjs = Find-IshDocumentObj -IshSession $ishSession `
  11. -RequestedMetadata $requestedMetadata `
  12. -IshTypeFilter ('ISHLibrary','ISHModule','ISHMasterDoc',' ISHTemplate','ISHIllustration')
  13.  
  14. foreach ($ishObject in $documentObjs){
  15. $location = Get-IshDocumentObjFolderLocation -IshSession $ishSession -IshObject $ishObject
  16. $name = $ishObject | Get-IshMetadataField -IshSession $ishSession -Name FTITLE -Level Logical
  17. echo "$location\$name" | out-file -encoding ascii -append 'ls.txt'
  18. }
  19.  
  20. # Do the same kind of thing for publications, but include the version and output type in our output file so we can
  21. # easily distinguish between entries.
  22.  
  23. echo "" | out-file -encoding ascii -append 'ls.txt'
  24. echo "[Publications]" | out-file -encoding ascii -append 'ls.txt'
  25.  
  26. $requestedMetadata = Set-IshRequestedMetadataField -IshSession $ishSession -Name FTITLE -Level Logical |
  27. Set-IshRequestedMetadataField -IshSession $ishSession -Name VERSION -Level Version |
  28. Set-IshRequestedMetadataField -IshSession $ishSession -Name FISHOUTPUTFORMATREF -Level Lng
  29. $ishPublications = Find-IshPublicationOutput -IshSession $ishSession -RequestedMetadata $requestedMetadata
  30.  
  31. foreach ($ishPublication in $ishPublications){
  32. $location = Get-IshPublicationOutputFolderLocation -IshSession $ishSession -IshObject $ishPublication
  33. $name = $ishPublication | Get-IshMetadataField -IshSession $ishSession -Name FTITLE -Level Logical
  34. $version = $ishPublication | Get-IshMetadataField -IshSession $ishSession -Name VERSION -Level Version
  35. $output = $ishPublication | Get-IshMetadataField -IshSession $ishSession -Name FISHOUTPUTFORMATREF -Level Lng
  36. echo "$location\$name '$output v$version'" | out-file -encoding ascii -append 'ls.txt'
  37. }
Add Comment
Please, Sign In to add comment