This is a 3 part "wish list" request, if such a list exists:
Item 1: Can you share a code snippet.
Item 2: The following blog post may help.
Item 3: Please explain what is it you would like to accomplish.
Item 1. Here is an example. $InputFile is definitely pointing to an .xlsx file - the code below verifies that it exists
PS C:\> New-PWLogin -DatasourceName $dsname -BentleyIMSTrue
PS C:\> $files = Get-PWDocumentsBySearch -FolderPath $TargetFolder
PS C:\> $files.Count1
PS C:\> Test-Path -Path $InputFile -PathType LeafTrue
PS C:\> Import-PWDocumentsBySpreadsheet -InputFile $InputFile -TargetProjectWiseFolder $TargetFolderWARNING: Object reference not set to an instance of an object.WARNING: at PWPS_DAB.ImportExport.ImportFromSpreadsheet(String sInputSpreadsheet, String sTargetFolderPath, Int32 iProjectId, Int32 iStorageId, Int32 iEnvironmentId, Int32 iWorkflowId, Boolean bCreateNewVersionIfExists, Boolean bJustUpdateAttributes, Boolean bSkipAuditTrail, Boolean bWriteBackLinks, Boolean bDeleteFilesOnImport, Boolean bCreateMissingFiles, PSCmdlet cmdlet)
PS C:\>Item 2: It does help, very much! Thank you!Item 3: I would like to, programmatically, import a Civil 3D data shortcut project and convert it to a DSPROJ file in the same way that the ProjectWise Data Shortcut Project Editor does, and also import all of the associated drawings (ESPECIALLY if I can provide a folder path where to search for the associated drawings). pull these drawings in to projectwise and update the data shortcuts to point to the files in projectwise to the destination of my choice. additionally, it might also be useful to skip the drawing import part and instead link up the references to files that are already in projectwise, (somewhere within a folder heirarchy that I specify). Then, at a later date, I want to export the DSPROJ file from ProjectWise (along with the linked drawings) and turn it all back into something that Civil 3D can read. In other words, I would like to automate just about every aspect of the Data Shortcut Project Editor. This would be tremendous for us. Thanks for listening!
Is it possible the spreadsheet contents don't match what the cmdlet wants?
that's the exact spirit of my wishlist item. this spreadsheet is perfectly valid for the manual workflow of importing documents using a spreadsheet. Apparently, the cmdlet has some specific column name requirements which are different from the manual workflow & they should not be different.
You can use the Export-PWDocuments or Save-PWDocumentsReport to generate a properly formatted spreadsheet.
Thanks for the tip, but my wishlist item stands. I was hoping for a version of the commandlet that supports the same format as the spreadsheets that are used by the Explorer function that imports and exports spreadsheets.