Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Cannot find an overload for "GetFileItems" and the argument count: "4".

$
0
0

I have need to call in and use custom .net code for interacting with TFS.

Here is the code I'm using

$dlls = gci D:\scripts\ps1\tfs\TfsApiLib\lib\net45
foreach ($dll in $dlls)
{
    $assembly = [Reflection.Assembly]::LoadFile($dll.FullName).getName()
    add-type -path $dll.FullName
 }

$t = new-object TfsApiLib.Tool.Methods.TfsApiMethods
$branch = "Branch";
$folderList = "Office","Admin"
$exclusionList = "t","h"

$list = New-Object System.Collections.Generic.List[System.String]
$exclude = New-Object System.Collections.Generic.List[System.String]
foreach($item in $folderList)
{
    $list.add($item)
}
foreach($i in $exclusionList)
{
    $exclude.add($i)
}

$filelist = $t.GetFileItems($collectionUrl, $projectName, $list, $exclude)  <-- this is the line that errors.

I'm passing 4 args to this C# function but still don't understand why it says I'm not.

The function once I get the import of the dll's in place expects:

a collection url = tfs server name and address

a project name = project to query once connected

a generic C# list = list of folders in the project to query

a generic C# list  = list of folders or items to exclude


Viewing all articles
Browse latest Browse all 6937

Trending Articles