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?

posta 2 anni fa802 visualizzazioni
3 Risposte
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
TECNICO DI SUPPORTO
con risposta 2 anni fa
0

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

con risposta 2 anni fa
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
TECNICO DI SUPPORTO
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande