Multiple Folders in New-PWScanForReferences -Priority

I am trying to use the New-PWScanForReferences  cmdlet and have it scan multiple Folders to find the references.  The executable wants these separated with a semicolon but this doesn't seem to work.  Per the executable's help, I would also proceed the folder with 'r:' for recursive, but this also does not work and appears to need the -RecursePriority.  It seems a trailing backslash is needed even though the help for the executable does not have this requirement.

From the executable's help:

For example, the combination of:
-masterfolders "Top level folder 3" -masterfolders "Top level folder 1;Top level folder 2"
is equivalent to:
-masterfolders "Top level folder 3;Top level folder 1;Top level folder 2"

My code is:

$myPriority = 'Folder 1\subfolder\;Folder 2\;Folder 3\'

$NewScanRef = @{
DataSourceName = 'myDatasource';
UserName = 'myUserName';
Password = 'mypassword;
ScanMode = 'references;linksets';
MasterDocuments = '{' + $myDocumentGUID + '}';
Priority = $myPriority;
#Proximity = 'r:1';
Order = 'priority;proximity';
#Applications = '';
LogFilePath = $myLogpath ;
}
New-PWScanForReferences @NewScanRef -RecurseMasterFolders -RecursePriority

I have also tried using 

$myPriority = @("Folder 1\subfolder\","Folder 2\","Folder 3\")

And

$myPriority = "Folder 1\subfolder\","Folder 2\","Folder 3\"

With no success.  What am I missing?

Parents
  • In the help presented here:

    https://communities.bentley.com/products/projectwise/w/wiki/40173/using-scanrefs-exe

    Folder lists 

    - begin with the top level folder

    - are separated by backslashes ie \

    0 Do not end with a trailing backslash

    Your first attempt at a folder list is

    $myPriority = 'Folder 1\subfolder\;Folder 2\;Folder 3\'

    Is Folder 1 the top level folder?

    You should not have the trailing backslash.

    It looks like the RecursePriority switch just prefixes the path with r:

    That's all good if you just have one path but I'm not sure what it would mean if you had multiple paths separated by semicolons.  I'd try the search without the RecursePriority switch first.  Then I would put the r: in the appropriate place(s) rather than use the switch.

    Scanrefs has always been a bit of an art.  If you can come up with a working  OS scanref command line does not translate into a PowerShell command please post it.

    Hope this helps,

    Mark Weisman | Bentley Systems

Reply
  • In the help presented here:

    https://communities.bentley.com/products/projectwise/w/wiki/40173/using-scanrefs-exe

    Folder lists 

    - begin with the top level folder

    - are separated by backslashes ie \

    0 Do not end with a trailing backslash

    Your first attempt at a folder list is

    $myPriority = 'Folder 1\subfolder\;Folder 2\;Folder 3\'

    Is Folder 1 the top level folder?

    You should not have the trailing backslash.

    It looks like the RecursePriority switch just prefixes the path with r:

    That's all good if you just have one path but I'm not sure what it would mean if you had multiple paths separated by semicolons.  I'd try the search without the RecursePriority switch first.  Then I would put the r: in the appropriate place(s) rather than use the switch.

    Scanrefs has always been a bit of an art.  If you can come up with a working  OS scanref command line does not translate into a PowerShell command please post it.

    Hope this helps,

    Mark Weisman | Bentley Systems

Children
No Data