Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99637

Generate PowerShell model file on-the-fly from vscode

$
0
0

We are building a private library of Azure DevOps tasks for DevOps teams to consume. On the one hand we maintain a definition file tasks.json for every custom task that specify the input parameters the engineers will need to provide, e.g.

"inputs": [
        {
            "name": "ConnectedServiceName",
            "type": "connectedService:AzureRM",
            "label": "Azure RM Subscription",
            "defaultValue": "",
            "required": true,
            "helpMarkDown": "Select the Azure Resource Manager subscription for the deployment."
        }
]

On the other hand we request the incoming input values from PowerShell as part of the task's execution code, e.g.:

$serviceNameInput = Get-VstsInput -Name ConnectedServiceNameSelector -Default 'ConnectedServiceName'
$serviceName = Get-VstsInput -Name $serviceNameInput -Default (Get-VstsInput -Name DeploymentEnvironmentName)

It requires discipline and sharp eyes to keep the identifiers in sync. Ideally we would like to have a PowerShell proxy class or model file available on the fly that is being regenerated every time this tasks.json is changed, providing IntelliSense while programming the task's execution code.

How can we set up this up the best way?


Viewing all articles
Browse latest Browse all 99637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>