Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using PowerShell3 execution causes "Cannot process command because of one or more missing mandatory parameters" #107

Closed
ghowlett2020 opened this issue Jul 24, 2016 · 2 comments

Comments

@ghowlett2020
Copy link

ghowlett2020 commented Jul 24, 2016

Hi,

I have a task using the following input...

 "inputs": [
     {
      "name": "NuGetServerEndpoint",
      "type": "connectedService:Generic",
      "label": "NuGet Server Endpoint",
      "required": true,
      "helpMarkDown": "The NuGet server generic endpoint."
    }
  ],

and in my PowerShell script have the corresponding Params

Param
(
    [Parameter(Mandatory=$true)]
    [string]$NuGetServerEndpoint
)

If i use "PowerShell" the task runs fine - however when i use "PowerShell3" i get the error as per the subject "Cannot process command because of one or more missing mandatory parameters"

Do i need a different type when using Powershell3? I have installed the ps module as per the documentation and when running locally "Invoke-VstsTaskScript -ScriptBlock { . .\MyTask.ps1 }" all works fine (except im asked for the parameter $NuGetServerEndpoint) despite the fact i declare it as...

$env:INPUT_NuGetServerEndpoint = "EP1"
$env:ENDPOINT_URL_EP1 = 'http://nuget.org'
$env:ENDPOINT_AUTH_EP1 = '{ "Parameters": { "UserName": "Some user", "Password": "Some password" }, "Scheme": "Some scheme" }'
$env:ENDPOINT_DATA_EP1 = '{ "Key1": "Value1", "Key2": "Value2" }'

Can you please provide some help on this?

Much appreciated
ExampleFiles.zip.zip

@ericsciple
Copy link
Contributor

You need to use Get-VstsInput to get the input, and Get-VstsEndpoint to get the endpoint.

I'm working on docs right now. Better getting started docs coming soon.

@ghowlett2020
Copy link
Author

Many thanks - using Get-VstsInput works.

+1 for those documents :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants