Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法使用 Powershell 获取实例的描述(例如,实例 ID、AMI ID、VPC ID....等)和标签?
我试过 Get-EC2Instance | select *了,但它没有提供我需要的所有信息。
Get-EC2Instance | select *
好的起点是将您的实例存储在一个变量中。
$ec2 = Get-EC2Instance $ec2.instances
将显示您可以获得的所有信息。
同样可以这样做
(Get-EC2Instance).Instances
或仅过滤您需要的内容。
(Get-EC2Instance).Instances | select-object ImageId,InstanceId,VpcId