- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Invoke-WebRequest
在 Azure 中不起作用。我已在 Powershell ISE 中测试了相同的代码并且它有效。
这是错误:
4/8/2015 9:24:14 AM, Error: Microsoft.PowerShell.Utility\Write-Error : aa00-csmo-t2 - Could not download https://nage1.blob.core.w
indows.net/application/applicationcertificates.7z?sv=2014-02-14&sr=c&sig=ke1lxWQM%3D&se=2016-04-07T06%3A04%3A49Z&sp=r -
At Install-Certificates:168 char:168
+
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId :
Microsoft.PowerShell.Commands.WriteErrorException,Microsoft.PowerShell.Commands.WriteErrorCommand
这是我在 Powershell ISE 中使用的有效代码:
workflow test
{
$ApplicationCertsBlobUrl = 'https://nage1.blob.core.w
indows.net/application/applicationcertificates.7z?sv=2014-02-14&sr=c&sig=ke1lxWQM%3D&se=2016-04-07T06%3A04%3A49Z&sp=r'
$applicationCertsZipFileSource = 'C:\Temp\test.7z'
Invoke-WebRequest $ApplicationCertsBlobUrl -OutFile $applicationCertsZipFileSource
}
我也尝试过:
InlineScript
{
$client = New-Object System.Net.WebClient
$client.DownloadFile($using:ApplicationCertsBlobUrl, $using:applicationCertsZipFileSource)
}
但是我得到了这个异常:
4/8/2015 9:40:14 AM, Error: Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At Install-Certificates:164 char:164
+
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
最佳答案
我必须将 Invoke-WebRequest
包装在 InlineScript
中。
关于powershell - Invoke-WebRequest 在 Azure 自动化中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29503574/
我正在查看 WebRequest.Create 之间的文档和 WebRequest.CreateHttp来决定我应该在我的应用程序中使用哪个。我没有看到这两种方法之间有什么不同,除了 WebReque
我想知道 DefaultWebProxy 和 GetSystemWebProxy() 之间的主要区别是什么。 MSDN 上有一些描述,但我仍然觉得我需要更多细节才能更好地理解。 此外,假设我在 C#
我想在 UI 上显示下载正在进行时下载文件。使用 WebRequest 我有两个选择: 使用 WebRequest.BeginGetResponse 和相关方法。 优点:可以以字节为单位显示准确的进度
我正在尝试注销对 MonoTouch 库的引用,所使用的是: IWebProxy oDefaultProxy = CFNetwork.GetDefaultProxy (); 在 .NET 中,还有
我首先发布了这个:HttpWebRequest: How to find a postal code at Canada Post through a WebRequest with x-www-fo
在 Windows PowerShell 3.0 中引入了 Invoke-RestMethod小命令。 Invoke-RestMethod cmdlet 接受 -Body用于设置请求正文的参数。 由于
我正在尝试在.bat文件中下载一个exe,但是无法隐藏输出 $progressPreference = 'silentlyContinue'| Out-Null 和$null 2>&1. 我不知道为什
我正在尝试 curl 包含分号的有效负载,但它失败了 Invoke-WebRequest -Uri $uri -Body '{"text" : "foo;"}' -Method Post Invoke
我有一个带有状态页面的网络设备,该页面可以通过Java小程序访问。使用Fiddler,我可以找到状态的http提要,但是页面会不断刷新。 (Firefox会显示该页面,但会保持刷新状态,Chrome会
有人可以向我解释为什么cUrl(真正的网址)有效但Invoke-WebRequest无效吗?同一台机器,相同变量。在我看来,他们俩都应该做同样的事情,将文件上传到jfrog Artifactory。
我正在尝试在 WebRequest 中发送表单数据。 该函数工作正常并按预期返回“成功”响应流。 但是,如果“data”变量的长度超过 30,000 个字符,我会遇到 HTTP 500 错误: Mes
我正在尝试在 WebRequest 中发送表单数据。 该函数工作正常并按预期返回“成功”响应流。 但是,如果“data”变量的长度超过 30,000 个字符,我会遇到 HTTP 500 错误: Mes
下面的代码需要怎么修改才能发送WebRequest通过指定的 proxy server和 port number ? Dim Request As HttpWebRequest = WebReques
我想执行一堆 WebRequest,但设置了可以同时启动的阈值。 我遇到了这个LimitedConcurrencyTaskScheduler example并尝试像这样使用它 scheduler =
我使用下面的代码在线检查一些pdf文件并相应地返回一个字符串。 问题是:当我添加第二个 Task.Factory.StartNew() 时,它开始复制所有请求,但仍然只返回一个答案(应该如此)。 我需
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(baseurl + url); req.Timeout = 1000 * 10;
我正在使用 WebRequest 执行简单请求,应用程序只是挂起,直到响应返回。我该如何解决这个问题? 看了很多题目,都说要用线程。我不知道如何使用它们;任何人都可以提供以下不挂起用户界面的示例吗?
以下代码在 WinForms 和 Windows Phone 8 应用程序中返回错误。 代码 var jsonData = "jsonStringGoesHere"; var uri
我正在用 C# 构建一个网络抓取工具,用于处理代理和大量请求。页面通过 ConnectionManager 类加载,该类获取代理并使用随机代理重试加载该页面,直到页面被正确加载。 平均一个任务需要10
我在做一个项目,多次调用一个网址 request = (HttpWebRequest)WebRequest.Create(url); request.GetResponse(); 这是我的代码。
我是一名优秀的程序员,十分优秀!