Start a new topic

PowerJobs delete file

I'm unable to find a commandlet to delete files with powerjobs.
Is it possible?
I am be able to RemoveAttachments from Item, but I need to delete this unattached files.
1 Comment

Hallo Tomás,

we do not have a commandlet that deletes files from Vault, but you can use the Vault API to achieve that.

There are a couple of functions in the DocumentService that might be what you need.

  • DeleteFileFromFolder  
  • DeleteFileFromFolderUnconditional  
  • DeleteFilesFromFolder  
  • DeleteFilesFromFolderUnconditional  

You can find a detailed description of all of them in the Vault SDK help file in Autodesk.Connectivity.WebServices Namespace : DocumentService Class

In powershell this could look something like this for the DeleteFileFromFolder function

$folder = $vault.DocumentService.GetFolderByPath($file._EntityPath)

$vault.DocumentService.DeleteFileFromFolder($file.MasterId, $folder.Id )

1 person likes this
Login or Signup to post a comment