0

I am facing below issue in AzSK_SVTs release pipeline:

Framework\Abstracts\CommandBase.ps1:250 char:22
$userChoice = Read-Host "Continue (Y/N)"
~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Read-Host], PSInvalidOper
ationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.R
eadHostCommand

Its asking for user choice in pipeline, how can we resolve it?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Swapnil S.
  • 11
  • 3
  • It seems this issue comes from your `CommandBase.ps1` file, have you try to execute this powershell scripts directly without azure devops pipeline to check if this issue is related to the azure devops? – Leo Liu May 28 '21 at 01:37
  • 1
    I tried running the scan locally and it worked fine, it asked me for choice and once the input was provided it continued the scan. But in the pipeline we are using service connection, and the assumption was it wont ask for user choice there but its asking and as of now I do not know any way to provide the input. If the choice needs to be provided for the first time then that is a manual thing which is not good for automation. – Swapnil S. May 28 '21 at 05:50
  • which task you are using to execute the `.ps1` scripts? Azure powershell task? – Leo Liu May 28 '21 at 05:58
  • I have added only one task in pipeline i.e. AzSK Security Verification Tests and all possible configurations are provided. I am not running any ps file separately. I thought the user choice is asked only if we run the scan manually in powershell but that is not the case. – Swapnil S. May 28 '21 at 06:50
  • I went through CommandBase.ps1 file, and the issue seems to be because of other running powershell instances. Looking for to fix it now. – Swapnil S. May 28 '21 at 08:46
  • How about the result? Have you resolved this issue? If not, would you please let me know the latest information about this issue? – Leo Liu May 31 '21 at 06:18
  • Yes, we prepared new agent from scratch and used it, everything worked fine on that. – Swapnil S. Jun 10 '21 at 06:35

0 Answers0