Powershell Win32内部错误";句柄无效";获取控制台模式时发生0x6

Powershell Win32内部错误";句柄无效";获取控制台模式时发生0x6,powershell,azure,Powershell,Azure,我目前在一个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 Cust

我目前在一个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.
这发生在新项目和删除项目上。它发生在Kudo Powershell控制台中,并在WebJob中使用Powershell脚本

我成功地使用了
echo3>>文件,而不是
新项目文件
。这样做没有问题。我发现的唯一一件事是,使用
调用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

对我来说,设置
$ProgressPreference=“SilentlyContinue”
确实解决了这个问题。 (使用Azure应用程序服务Kudu站点的PowerShell控制台。)

$null |(…)>$null
也可以防止错误,但这也会抑制返回值,我不希望返回值


背景:显然,
invokewebrequest
试图显示一个进度条,而Kudu的PowerShell不支持该进度条。()

您是否尝试从本地计算机远程运行这些cmdlet?否,我无法将本地powershell连接到WebApp。似乎有问题,因为我使用了Dreamspark订阅。我在Kudo Powershell和WebJob中运行它们。我也有同样的问题。你解决过吗?没有,很不幸。