使用PowerShell使用REST API调用的限制
我需要使用PowerShell通过REST API调用进行一些历史数据。我被数据量超过4 GB的终点之一所困。当我在PowerShell ISE中运行PowerShell脚本时,它可以按预期运行。但是,当我通过SQL Server Integration Services执行进程任务时,将无法下载JSON有效负载。
有更好的方法解决这个问题吗?是否应该注意任何限制?
$Header = @{
"authorization" = "Bearer $token"
}
#make REST API call
$Parameters = @{
Method = "GET"
Uri = "https://api.mysite.com/v1/data"
Headers = $Header
ContentType = "application/json"
Body = $BodyJson
}
Invoke-RestMethod @Parameters
错误: system.outofmemoryexception
I have a need to make a few historical data pulls via REST API call using Powershell. I'm stuck with one of the endpoints where the data volume is over 4 GB. When I run the Powershell script in the Powershell ISE it works as expected. But, When I run the same via SQL Server Integration Services Execute Process Task it's not able to download the JSON payload.
Is there a better way to tackle this? Are there any limitations one should be mindful of?
$Header = @{
"authorization" = "Bearer $token"
}
#make REST API call
$Parameters = @{
Method = "GET"
Uri = "https://api.mysite.com/v1/data"
Headers = $Header
ContentType = "application/json"
Body = $BodyJson
}
Invoke-RestMethod @Parameters
Error: System.OutOfMemoryException
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论