37539e: ERR ] New-Item : The Win32-6ren">
gpt4 book ai didi

powershell - 获取控制台模式时发生 Win32 内部错误 "The handle is invalid"0x6

转载 作者:行者123 更新时间:2023-12-01 02:04:48 27 4
gpt4 key购买 nike

我目前在 Web 应用程序中使用 azure 命令行时遇到一些问题。我收到以下错误:

[10/28/2015 20:22:33 > 37539e: ERR ] New-Item : The Win32 internal error "The handle is invalid" 0x6 occurred while 
[10/28/2015 20:22:33 > 37539e: ERR ] getting the console mode. Contact Microsoft Customer Support Services.

这发生在New-Item 和Remove-Item 上。它发生在 Kudo Powershell 控制台中并在 WebJob 中使用 Powershell 脚本。

我成功地使用了echo 3 >> file,而不是New-Item file。这没有问题。我发现的唯一一件事是使用 Invoke-WebRequst 存在问题,并且将使用

修复该问题
$ProgressPreference="SilentlyContinue"

不幸的是,这没有帮助。

有人经历过类似的事情吗?

提前致谢。

最佳答案

某些 cmdlet 可能会尝试读取连接到控制台的标准输入或标准输出流的控制台模式。通过将它们显式设置为 null 可以避免这种情况。

# Prevent the progress meter from trying to access the console mode
$ProgressPreference = "SilentlyContinue"

# Set the input and output streams to $null
$null | Invoke-WebRequest -UseBasicParsing http://www.example.com/ > $null

关于powershell - 获取控制台模式时发生 Win32 内部错误 "The handle is invalid"0x6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33401244/

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