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

如何使用PowerShell获取AWS Redshift集群的Endpoint信息?

获取AWS Redshift集群Endpoint信息的正确方法

解决方案

你可以通过以下几种方式获取实际的Endpoint详情:

  1. 展开Endpoint对象,查看其所有属性:
Get-RSCluster | Select-Object -ExpandProperty Endpoint

这会直接返回包含Address和Port的对象内容。

  1. 提取特定属性(如地址和端口):
Get-RSCluster | Select-Object @{Name="EndpointAddress"; Expression={$_.Endpoint.Address}}, @{Name="EndpointPort"; Expression={$_.Endpoint.Port}}

这样会以自定义列的形式展示地址和端口。

  1. 组合成完整的连接字符串格式:
Get-RSCluster | ForEach-Object { "$($_.Endpoint.Address):$($_.Endpoint.Port)" }

这会直接输出类似cluster-name.xxxxxx.region.redshift.amazonaws.com:5439的完整端点字符串。

原因说明

Get-RSCluster返回的Endpoint是一个对象类型(Amazon.Redshift.Model.Endpoint),而非简单的字符串。当你直接使用Select Endpoint时,PowerShell默认显示对象的类型名称,而非其内部属性值。通过-ExpandProperty或直接访问对象的子属性($_.Endpoint.Address),才能获取到实际的端点信息。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.24 16:39:19