Need help on recreating a few functions from existing CMDLET's, or getting existing CMDLET's updated...

I have been able to start using PWPS and create useful functions that work to fill some of our needs by using word searches in the forum, and connect-the-dots with snippets of found code.

  • ExportPWFolderSpecifcFilesToSpecificServerFolder - "Find" a list of files in a pw folder, a foreach loop to echo the files found, and a checkout -copyout to dump them in a server folder.
    • This does not get SubFolders, only files in the targeted folder. Removing the "-JustThisFolder" does get files in the subfolders, but the pipe into the "CheckOut-PWDocuments" only copies the files to the targeted folder, it does not create the subfolder tree and populate accordingly.
    • Functions:
      • $files = get-pwdocumentsbysearch -FolderPath "$ProjectWiseFolder" -JustThisFolder -Filename "$FilenameString" -verbose
      • $files | CheckOut-PWDocuments -NoReferences -RemoveCopies -Verbose -CopyOut -ExportFolder "$ServerFolder"
  • ImportMirrorServerFoldertoPWFolder - Mirror an outside Server folder into PW Folder
    • This does get the SubFolders and files in the subfolders and creates the same in PW
      • Import-PWDocuments -InputFolder $ServerFolder -MakeProjectWiseMatchDisk -ProjectWiseFolder $ProjectWiseFolder -Verbose

That said, I need some guidance/direction in how to get the necessary information to do a few other functions.

  • ExportPWFolderSpecifcFilesANDFOLDERS - Find the files and subfolders in a PW folder holding a series of subfolders, and create/mirror the same to a external folder with subfolders... seen no examples of that. I have some ideas but need guidance if this will be a heavy PowerShell multi-function data transform effort.
    • Seems like this would be in there somewhere, especially if the "Import-PWDocuments" function does exactly that inward.
  • ImportSINGLEFILEtoPWFolderCreateAnd/OrReplace - Identify a single file from a Server Folder, that contains multiple files, to create/replace/update a single file in a PW Folder, without affecting other Files/Folders in the same folder.
    • Sometimes you need to only create/update one targeted file rather than syncing all of the other 200 files and 6 subfolders.

Can the "CheckOut-PWDocuments" be updated to have a "-CreateAndPopulateSubfolders" switch?

Can the "Import-PWDocuments" be updated to have a "-JustOneFile" switch?

Can anyone suggest how I would otherwise approach these two functions?