Octopus.Client kullanarak bir ahtapot projesini klonlamaya çalışıyorum. Bu kullanıyorum kodudur:Klon Ahtapot Projesi
$OctopusURI = "http://localhost:8080"
$apikey = "API-SO7PMXWLYU6RPCUKMWK22GBKYQ"
$endpoint = new-object -TypeName Octopus.Client.OctopusClient(New-Object Octopus.Client.OctopusServerEndpoint($OctopusURI,$apikey))
$repository = new-object Octopus.Client.OctopusRepository $endpoint
$newproject = New-Object Octopus.Client.Model.ProjectResource
$OriginalProject = $repository.Projects.FindByName($projectToClone);
Write-Output $OriginalProject
$properties = [ordered]@{
Name = $Project_Name
Description = $Project_Description
ProjectGroupId = $OriginalProject.ProjectGroupId
LifecycleId = $OriginalProject.LifecycleId
}
$newproject = New-Object Octopus.Client.Model.ProjectResource -Property $properties
$endpoint.post("~/api/projects?clone=" + $OriginalProject.Id, $newproject)
Ve bu "post" ve argüman sayımı için bir aşırı bulamıyor
alıyorum hatadır: "2".
Bu
yöntemin tanımı şöyledir: sonrasıvoid Post[TResource](string path, TResource resource, System.Object pathParameters)
TResponse Post[TResource, TResponse](string path, TResource resource, System.Object pathParameters)
void Post(string path), void IOctopusClient.Post[TResource](string path, TResource resource, System.Object pathParameters)
TResponse IOctopusClient.Post[TResource, TResponse](string path, TResource resource, System.Object pathParameters),
void IOctopusClient.Post(string path)
, üçüncü parametre
Olduğu gibi, nesneye ve örneğinize eklediklerinden başka bir şey sağlamanız gerektiğini düşünmüyorum - pathParameters için boş bir değer sağlamaya değer. – Fenton