Remove-PWFolder Using Item/Object Array

Hi All -

Problem: I am attempting to use Remove-PWFolder to remove a large number of folders, 5984 exactly. I am trying to make use of the PWPS_DAB cmdlet Remove-PWFolder, but encounting issues. I have the specific paths for all the folders but finding it difficult to pass an array in as the cmdlet states it will accept.

I've tried creating a local PS instanced array passing folder paths (e.g. $pwFolders = @('root\sub1\sub2\foldertodelete1','root\sub1\sub2\foldertodelete2','root\sub1\sub2\foldertodelete3')) then trying to pass it in to the PW cmdlet as: "$pwFolders | ForEach-Object {Remove-PWFolder -FolderPath [$PSItem] -RemoveFolders -ProceedWithDelete}"

When I run this, I receive an error back stating "WARNING: Valid folder path must be provided." followed by a boolean value of "False". Looking at the -full get-Help of the Remove-PWFolder cmdlet, it looks like I could use -InputFolder instead of -FolderPath so I recreated the array as an object array on the fly in the command: Get-Content -Path "C:\PWScripts\pwFolders.txt" | ForEach-Object { [pscustomobject]@{ProjectWiseFolder = $PSItem} } | Remove-PWFolder -FolderPath [$PSItem] -RemoveFolders -ProceedWithDelete

This did not work either as it complained that each item passed in was not a valid object. Is there a way that if I have a list of folder paths, I can easily use the Powershell ProjectWise cmdlet to delete these folders. So far, the only success I've had is using: "Remove-PWFolder -FolderPath '<folderpath>' -RemoveFolders -ProceedWithDelete". It works, but cumbersome in this case because I have 5,984 folders to delete.

Also, it'd be nice to add a new cmdlet that functions similarly to New-PWFoldersFromSpreadsheet, except it would be Remove-PWFoldersFromSpreadsheet enabling the removal of folders via formatted spreadsheet.