Azure / trusted-signing-action

MIT License
35 stars 12 forks source link

Error "Windows PowerShell is in NonInteractive mode" #15

Closed danilobreda closed 4 months ago

danilobreda commented 4 months ago

When attempting to execute a task in Azure DevOps on a Windows environment, I'm encountering the following error:

"Exception calling 'ShouldContinue' with '2' argument(s): 'Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.'" "Exceção ao chamar "ShouldContinue" com "2" argumento(s): "O Windows PowerShell está no modo NonInteractive. A funcionalidade Read e Prompt não está disponível."

Following this Stack Overflow answer, Stack Overflow answer, I resolved the problem with this task before:

- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: |
      # Write your PowerShell commands here.

      if ($Null -eq (Get-PackageProvider -Name NuGet -ErrorAction Ignore)) {
          Install-PackageProvider -Name NuGet -Force -Scope CurrentUser;
      }

      if ($Null -eq (Get-InstalledModule -Name PowerShellGet -MinimumVersion 2.2.1 -ErrorAction Ignore)) {
          Install-Module PowerShellGet -MinimumVersion 2.2.1 -Scope CurrentUser -Force -AllowClobber;
      }
japarson commented 4 months ago

Thank you for filing this issue. I'll investigate.

japarson commented 4 months ago

@danilobreda I have a PR open to add guidance to the README for the Action. I'll add the same guidance to the Azure Pipelines Task in its next release as well.