question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VstsTaskSdk.psd1 not found

See original GitHub issue

Environment

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

  1. Create a custom build task that wraps a powershell script and uses the new powershell3 Task executer.
  2. Download the Sdk
  3. Package the extension
  4. Upload the extension
  5. 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:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jessehouwingcommented, May 5, 2020
0reactions
Angr1stcommented, May 5, 2020

#631 I opened a pr to improve the documenation for others and made this fact more explicit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSTS - Custom Build Task execution cannot find VstsTaskSdk ...
\VstsTaskSDK\0.8.0\VstsTaskSdk.psd1 . Or try moving the SDK files out of the 0.8.0 folder so that it's sitting in the VstsTaskSDK folder.
Read more >
VstsTaskSdk 0.11.0 - PowerShell Gallery
Install-Module -Name VstsTaskSdk. You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies ...
Read more >
Updated Build Task definitions do not work on the agents side
Exception: VSTS task module not found at expected location: ... (x86)\agent\tasks\VSBuild\1.0.43\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1.
Read more >
Custom Extension Can't Find Vststasksdk.Psd1 - ADocLib
ImportModule : The specified module 'ExchangeOnlineManagement' was not loaded because no valid module file was found in any module directory. Read full post....
Read more >
Azure DevOps deploy agent task "failed successfully" - Reddit
##[debug]$LASTEXITCODE is not set. ... \PowerShell_e213ff0f-5d5c-4791-802d-52ea3e7be1f1\2.194.0\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found