We are using Saved Searches for PDF Renditions and require the Saved Search to clear the previous search instead of recreating the Search.
This update is required so that the PDF Rendition jobs that use these Saved Searches do not get corrupted.
Just to clarify the situation, you have a saved search that is used by Renditions to identify files to render. You want to update the saved search but if you delete and replace the saved search with one of the same name the rendition job originally setup to use the old saved search can no longer find the saved search. Is that the situation?
Out of curiosity what are changing in the saved search? Generally where our rendition saved searches are identifying documents we use an environment attribute. If needed I would write a script to modify the environment attribute on each document, not modify the saved search each time.
Yes, saved search used by Renditions to identify files to render. Updating search will delete and replace the saved search via the PowerShell function.
Great question, the search is built with multiple OR tabs so it can search a different Work Area folder that contains a 'Drawings' folder. Thinking about it now, I wonder if multiple tabs is really required. Currently I would need to run this script to update whenever a new folder is created.
You CAN add an OR tab to an existing search using Add-PWSavedSearchOrGroup. I assume it merely updates the existing search and doesn't delete/replace.
I wonder if there isn't another way. For example, if you're always running this script before your renditions are run, why not have the script do all the work? You can use Get-PWDocumentsBySearch & Get-PWDocumentsBySearch Extended to find your documents then use New-PWRendtionRequest to submit those documents for rendtion for you.
NAME Add-PWSavedSearchOrGroup SYNOPSIS Add an OR group (page) to existing saved search. SYNTAX Add-PWSavedSearchOrGroup [-SearchName] <string> [[-Description] <string>] [[-OriginalsOnly] <SwitchParameter>] [[-Environment] <string>] [[-Attributes] <Hashtable>] [[-Workflow] <string>] [[-States] <string[]>] [[-UpdatedAfter] <DateTime>] [[-UpdatedBefore] <DateTime>] [[-Personal] <SwitchParameter>] [[-SearchFolder] <string>] [[-WholeDatasource] <SwitchParameter>] [[-SearchSubFolders] <SwitchParameter>] [[-SearchText] <string>] [[-WholePhrase] <SwitchParameter>] [[-AnyWord] <SwitchParameter>] [[-SearchAttributes] <SwitchParameter>] [[-DocumentName] <string>] [[-FileName] <string>] [<CommonParameters>] DESCRIPTION RELATED LINKS REMARKS To see the examples, type: "get-help Add-PWSavedSearchOrGroup -examples". For more information, type: "get-help Add-PWSavedSearchOrGroup -detailed". For technical information, type: "get-help Add-PWSavedSearchOrGroup -full".
NAME New-PWRenditionRequest SYNOPSIS Submits a rendition request for documents passed through the pipeline. Takes an optional Rendition Profile name. SYNTAX New-PWRenditionRequest [-InputDocuments] <ProjectWiseDocument[]> [[-ProfileName] <string>] [[-MakeSinglePlotRequest] <SwitchParameter>] [<CommonParameters>] DESCRIPTION Submits a rendition request for documents passed through the pipeline. Takes an optional Rendition Profile name. RELATED LINKS REMARKS To see the examples, type: "get-help New-PWRenditionRequest -examples". For more information, type: "get-help New-PWRenditionRequest -detailed". For technical information, type: "get-help New-PWRenditionRequest -full".
I have a Job scheduled in Bentley iCS for PDF Browser to check for new drawings at an interval.
I'll try relying on Environment, Workflow and State to filter my selection without specifying the Work Area folders. That might be the best solution.