|
Hey Mark;
Apologies for the delay, I've been swamped.
So, if I understand you correctly, you want to add (or remove) a project reference to a group of projects? You are correct that recursively searching under the projects: drive will take a long time, since the recursion dives into the code model and
project properties as well.
This is some sample code for adding references between projects; relatively untested, but I do this kind of thing all the time.
> $newProject = new-project -name MyNewProject;
> cd projects:
> dir | where {
#skip the new project and miscellaneous files collection
$_.Name -ne $newProject.Name -and $_.Name -notmatch "misc"
} | foreach {
pushd $_.PSPath;
# add a reference to the new project
if( test-path ./References ) { new-item -path ./References -type project -name $newProject.Name;
} popd;
}
Also, I just noted that the examples for the new-item documentation for the references node are wrong - they're actually copies of the breakpoint examples. I'll add a ticket to make sure this gets fixed.
If you still have trouble, follow up in this discussion.
Thanks,
jim
|