powershell - 尝试使用 Invoke-RestMethod 时出现此错误
问题描述
我正在尝试从 PowerShell 上的 Citrix 的 Odata API 中提取数据,只是一些用户及其会话的登录和注销时间。
它给了我以下错误:
Invoke-RestMethod : An error occurred while processing this request.
The method 'First' can only be used as a final query operation.
Consider using the method 'FirstOrDefault' in this instance instead.
在以下代码行:
$userdata = Invoke-RestMethod -uri "http://localhost/Citrix/Monitor/Odata/v1/Data/Users" -Credential $cred
我在脚本上没有使用任何“第一”方法。非常感谢您对此的帮助,谢谢!
解决方案
推荐阅读
- javascript - 如何使元素依赖于Angular中的数据属性?
- sql - 排序 DISTINCT 值而不在 SELECT 语句中
- javascript - JSON TIME 转换成新的 Date()?
- javascript - 响应式画布导致模糊缩放
- python - 尝试替换 DataFrame 的某些值时,Python 就地参数失败
- c# - 在运行时传递类名(不是实例化对象)作为方法参数
- windows - PowerShell Windows 媒体覆盖
- kubernetes - GitLab Runner:无法注册跑步者。您可能遇到网络问题
- php - PHP 在一段时间后停止服务请求并返回错误 502 - 504
- python - Django get 返回 ValueError: Field 'id' expected a number but got