VstsTaskSdk.psd1 not found
See original GitHub issueEnvironment
azure-pipelines-task-lib version: ? I am trying to build a build task that only runs on windows using the Powershell SDK (VstsTaskSDK Version 0.11.0).
Issue Description
I used the Save-Module -Name VstsTaskSdk -Path .\
command to download the newest version of the VstsTaskSDK. The path to the VstsTaskSdk.psd1 is
ps_modules\VstsTaskSdk\0.11.0\VstsTaskSdk.psd1
but when calling the build task it looks here:
ps_modules\VstsTaskSdk\VstsTaskSdk.psd1
Do I need to manually remove the 0.11.0 Folder or is there some configuration file or something to fix this? FYI I am not a powershell expert I basically want to wrap a dotnet executable and call that with the task.ps1. I started out using the legacy powershell task handler but azure devops showed that I should use this. If we find out what I am missing this should be added to the documentation.
Expected behaviour
It should find the VstsTaskSdk.psd1 even with the Version Number Folder.
Actual behaviour
It outputs:
##[error]File not found: ‘C:\Agent\vsts-agent-win-x64-2.165.2_work_tasks\MINTEST_e213000f-5d5c-4791-802d-52ea3e7be1f1\1.0.0\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1’
Steps to reproduce
- Create a custom build task that wraps a powershell script and uses the new powershell3 Task executer.
- Download the Sdk
- Package the extension
- Upload the extension
- Run Task
I have published my task here so you could alternatively just clone my repo and update the vss_extension.json.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Yeah, use exactly the structure above. the docs show this structure already:
https://github.com/microsoft/azure-pipelines-task-lib/blob/master/powershell/Docs/Consuming.md#package-the-sdk-with-the-task
#631 I opened a pr to improve the documenation for others and made this fact more explicit.