I notice that .fullpath and .fullpathold methods both include the document name. Is there a fullpath (or some other) method that includes the file name? Currently, I need to parse the path based on the last backslash and then concatenate with the file name.
Look at the powershell command split-path, you can use that to give you the different parts of the paths. It really just operates on strings so it works fine with Projectwise paths.
Thanks. This will give me different parts of the path but since the file name is not a part of .fullpath, I still need to concatenate with the file name if I need a path that includes it (unless I am missing something).
oh, duh. I missed the "document name" vs. "filename". yes, you'll have to concatenate the path back together with the filename, you can use join-path for that:
$doc = Get-PWDocumentsBySearch -FolderPath "folderpath" -Filename "filename" -slow
$path = $doc.fullpath | split-path
$filepath = join-path -Path $path -ChildPath $Doc.Filename
or in 1 line:
$filepath = join-path -Path (Split-Path -Path $doc.FullPath) -ChildPath $doc.Filename
You could try something like the following:
$Doc = Get-PWDocumentsBySearch -FolderPath 'Test\New' -DocumentName 'A111-View-1' -JustThisFolder -GetAttributes -Verbose$FullPath = ($Doc.FullPath).Replace($Doc.Name, $doc.FileName)