首页 > 解决方案 > 尝试使用 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

我在脚本上没有使用任何“第一”方法。非常感谢您对此的帮助,谢谢!

标签: powershellodatacitrix

解决方案


推荐阅读