How to delete all PDFs based on Publication Type

Hi,

I'd like to delete all the PDFs based on a publication type. I know I can search for the pub type and get a list of all the publications a pub type has been used. Using this method I have to delete each pdf one by one. I'm hoping for a method where I can delete all the PDFs at once. Is this possible?

KR

Mario Madunic

emoji
Parents
  • Hi Mario,

    Quick Friday afternoon response... I cannot immediately come up with a quick user interface optimization on your scenario. I can offer you an alternative using the PowerShell-based ISHRemote toolkit.

    Some background information, webinar videos and how to get started with the PowerShell ISHRemote library is on https://github.com/RWS/ISHRemote/ 

    New-IshSession -WsBaseUrl https://... # so have a working session
    
    # When you refer to '...all the PDFs based on a publication type' it probably means an OutputFormat
    # Below cmdlet lists all your OutputFormats, the cleanest route is to track the Id(entifier) GUID
    Find-IshOutputFormat
    
    # Let's create a filter to find all PublicationOutput (so Logical-Version-Language) entries having that OutputFormat
    $metadataFilter = Set-IshMetadataFilterField -Level Lng -Name FISHOUTPUTFORMATREF -FilterOperator In -ValueType Element -Value "GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    
    # If your database size is relatively small you can do a single catch-all query... if your expect millions of hits, 
    # it is better to loop over the folder structure, see https://github.com/RWS/ISHRemote/blob/master/Doc/ReleaseNotes-ISHRemote-0.13.md#repository-corrections
    Find-IshPublicationOutput -MetadataFilter $metadataFilter
    
    # in PowerShell there is concept of pipeline the results of one cmdlet (mini-function), into the next
    Find-IshPublicationOutput -MetadataFilter $metadataFilter | 
    Remove-IshPublicationOutput -WhatIf
    
    # if you would like some confirmation, this is a nice multi-select gridview
    Find-IshPublicationOutput -MetadataFilter $metadataFilter | 
    Out-GridView -PassThru |
    Remove-IshPublicationOutput -WhatIf
    
    # Important so far nothing was removed from your repository, only read actions... 
    # if you remove the "-WhatIf" parameter fromt the Remove-cmdlet, then data will be trully removed!

    Best wishes,
    Dave

    emoji
Reply Children
No Data