get-ec2instance does not show platformdetails info

0

I am trying to get ec2 instance platform info but this is shopwing blank except for windows instances

(get-ec2instance -instanceid instanceid | select-object -expandproperty Instances).Platform

any idea?

질문됨 2년 전802회 조회
3개 답변
1

Hello, The "Get-EC2Instance" cmdlet calls the DescribeInstances API operation[1].

According to the documentation for the DescribeInstances API:
"The value is Windows for Windows instances; otherwise blank."[2]

[1] https://docs.aws.amazon.com/powershell/latest/reference/
[2] https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html

AWS
지원 엔지니어
답변함 2년 전
0

Is there anyway to get platform details for linux using powershell?

답변함 2년 전
0

I would suggest installing the AWS CLI for Windows[1]. The referenced page provides instructions for installation in Windows.

You could then use the following command:

aws ec2 describe-instances | Select-String "InstanceId","PlatformDetails"

While the Get-EC2Instance only returns a "Platform" parameter, which is blank for non-Windows instances, the "describe-instances" CLI command provides a "PlatformDetails" parameter which will indicate "Linux/UNIX" for instances running a Linux OS.

[1] https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

AWS
지원 엔지니어
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠