Powershell in NonInteractive mode

前端 未结 2 2018
伪装坚强ぢ
伪装坚强ぢ 2021-02-12 05:54

I use Octopus for our deployments. I have a problem with one of the Powershell scripts to control the deployment:

# stops running processes
$processes = @(\"Note         


        
相关标签:
2条回答
  • 2021-02-12 06:03

    I just tried to use Remove-Item on the directory with children and got same message: Remove-Item : PowerShell is in NonInteractive mode. Read and Prompt functionality is not available. In my case -Recurse key has helped.

    0 讨论(0)
  • 2021-02-12 06:20

    Run with -Force:

    Stop-Process -InputObject $prc -ErrorAction SilentlyContinue -Force

    As C.B. suggested in the comment: -confirm:$false should also work. Rationale for this is as follows: -Confirm is a switch parameter. Switch parameters can only take arguments if you specify the parameter with a trailing colon and a value.

    0 讨论(0)
提交回复
热议问题