You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用PowerShell Get-LMFunctionList时遇安全令牌无效错误,AWS CLI正常

AWS PowerShell模块调用Lambda接口报错问题

环境信息

  • PowerShell版本:5.1
  • AWS.Tools.Lambda版本:4.1.530

问题现象

导入AWS.Tools.Lambda模块后,执行PowerShell命令:

Get-LMFunctionList -Region "eu-west-1"

收到错误提示:

Get-LMFunctionList : The security token included in the request is invalid

但执行对应的AWS CLI命令:

aws lambda list-functions --region eu-west-1

完全正常,可成功获取Lambda函数详情,说明问题仅针对该PowerShell命令。

已尝试的无效解决方案

  • 新建访问密钥并添加到凭证文件
  • 使用aws configure重新生成.aws\credentials文件
  • 多次重启PowerShell会话
  • 未使用会话密钥进行连接
  • 排除配置文件问题(CLI可正常使用)
  • .aws\cli\cache\目录无缓存文件

内容的提问来源于stack exchange,提问作者gerard

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 19:33:10