RWS/ISHRemote

How to remove versions of maps and topics in repo

Closed this issue · 1 comments

Hi,
I am new to Tridion Docs and Powershell and have just discovered your PowerShell module. I would like to use it to clean out a folder on our Tridion Docs server which I am using for testing. I can create a script to remove all the folder contents using Get-IshFolder -FolderPath $folderRoot -Recurse | Get-IshFolderContent | Remove-IshDocumentObj -Force
and to remove all the folders using
Remove-IshFolder -FolderPath '\Publications\*'
but I don't know how to first remove any versions of maps and topics that might exist.
Can you advise which cmdlet(s) I can use to achieve this?
Any advice appreciated,
Regards,
Ann

I'll cross post the answer I gave on https://community.sdl.com/developers-more/developers/tridiondocs-developers/f/livecontent_developer_forum/31449/how-to-remove-document-versions-for-publications-maps-and-topics-using-ishremote

Hi Ann,
It seems you are on the right track, probably the clue is in "what stops the deletion of that map/topic"?

Important is that you are deleting/removing from a Repository (not a file system), so besides security and workflow there are quite some business logic rules to make sure that the system offers integrity.

Please have a look at https://github.com/sdl/ISHRemote/blob/master/Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/PublicationOutput/AddIshPublicationOutput.Tests.ps1 which is a Pester-based integration test on top of the ISHRemote PowerShell module. At the bottom in the finally clause you see that the tests removes all of the artifacts it created higher up in the test.

Hope this helps,
Dave