gpt4 book ai didi

powershell - 强制不在非交互模式下工作

转载 作者:行者123 更新时间:2023-12-03 07:59:35 28 4
gpt4 key购买 nike

Deleting folder 'C:\agent\_work\2\a\Foo\_PublishedWebsites\Foo\sourcejs'

Remove-Item : Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.
At C:\agent\_work\2\s\Build\Deployment\PrepareWebsites.ps1:29 char:2
+ Remove-Item -Path $source -Force -Confirm:$false | Where { $_.PSIsContainer }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Remove-Item], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.RemoveItemCommand

Process completed with exit code 1 and had 1 error(s) written to the error stream.

我尝试添加 -Force 和 -Confirm:$false 但我仍然收到此错误。使用 TFS 2015 构建。有人有任何想法吗?

最佳答案

Remove-Item -path 'C:\agent\_work\2\a\Foo\_PublishedWebsites\Foo\sourcejs\*' -Recurse -Force -EA SilentlyContinue -Verbose

关于powershell - 强制不在非交互模式下工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38334539/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com