kine / MSDyn365BC_AppTemplate

Template for MS Dynamics 365 Business Centrall App development with Azure DevOps pipeline
MIT License
17 stars 17 forks source link

Exception calling “ShouldContinue” .. Windows NonInteractiveMode while Install-Module #2

Closed andreasblueher closed 5 years ago

andreasblueher commented 5 years ago

Hello Kamil,

we went ahead and pushed your template to our project/repository. The first build failed although we followed the instructions in the readme.

I found this article from 2016 in which the author complains about PowerShell in ADO and what Microsoft should improve. In the end we had to run the command he suggested Install-PackageProvider -Name NuGet -Force -Scope CurrentUser

On the machine which hosted our agent we had before ran the following commands Set-ExecutionPolicy Unrestricted Install-PackageProvider -Name nuget Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

The user which ran the agent had the NVR module installed, but stil the agent tried to install it everytime.

I don't think this issue is related to your template, but people might run into this aswell. Maybe you can add it into your instructions.

kine commented 5 years ago

It is ok, the template will install the module each time. It is because it is planned to support hosted agents and in this case the process must install everything it needs to build sucessfully. I will try to add one step to the template - installing nuget tool - as part of the pipeline.

kine commented 5 years ago

To install nuget tool in pipeline, you can use this task in yaml:

steps:
- task: NuGetToolInstaller@0
  displayName: 'Use NuGet 4.3.0'

See https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/nuget?view=vsts for more info.

kine commented 5 years ago

The whole process is expecting that the environment is clean to be able to run even on Azure Hosted agents (but first I need to finetune the NavUserPassword authentication everywhere). Thus the install is running each time and if installed, than update is called. It should not display any interactive things, but if user installed the module manually system-wide, it could be in conflict, because the template is installing them into context of CurrentUser. In this case, try to uninstall all available versions of NVRAppDevOps and navcontainerhelper an let the pipeline to install them.

andreasblueher commented 5 years ago

Sorry for not replying to your other posts. I did setup a private agent, but wasn't able to install NVRAppDevOps or Navcontainerhelper due to the error message in my first post. Using the step from the pipeline did not solve the issue.

I'll recreate the virtual machine from scratch within the next 2 days and let you know if I run into those issues again. Thanks!