

Weitere AWS SDK-Beispiele sind im GitHub Repo [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) verfügbar.

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

# Verwendung von `GetInstanceProfile` mit einer CLI
<a name="iam_example_iam_GetInstanceProfile_section"></a>

Die folgenden Code-Beispiele zeigen, wie `GetInstanceProfile` verwendet wird.

------
#### [ CLI ]

**AWS CLI**  
**So rufen Sie Informationen zu einem Instance-Profil ab**  
Der folgende Befehl `get-instance-profile` ruft Informationen über das Instance-Profil mit dem Namen `ExampleInstanceProfile` ab.  

```
aws iam get-instance-profile \
    --instance-profile-name ExampleInstanceProfile
```
Ausgabe:  

```
{
    "InstanceProfile": {
        "InstanceProfileId": "AID2MAB8DPLSRHEXAMPLE",
        "Roles": [
            {
                "AssumeRolePolicyDocument": "<URL-encoded-JSON>",
                "RoleId": "AIDGPMS9RO4H3FEXAMPLE",
                "CreateDate": "2013-01-09T06:33:26Z",
                "RoleName": "Test-Role",
                "Path": "/",
                "Arn": "arn:aws:iam::336924118301:role/Test-Role"
            }
        ],
        "CreateDate": "2013-06-12T23:52:02Z",
        "InstanceProfileName": "ExampleInstanceProfile",
        "Path": "/",
        "Arn": "arn:aws:iam::336924118301:instance-profile/ExampleInstanceProfile"
    }
}
```
Weitere Informationen finden Sie unter [Verwenden von Instance-Profilen](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) im *AWS -IAM-Benutzerhandbuch*.  
+  Einzelheiten zur API finden Sie [GetInstanceProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/get-instance-profile.html)in der *AWS CLI Befehlsreferenz*. 

------
#### [ PowerShell ]

**Tools für PowerShell V4**  
**Beispiel 1: In diesem Beispiel werden Details des genannten Instanzprofils zurückgegeben`ec2instancerole`, das im aktuellen AWS Konto definiert ist.**  

```
Get-IAMInstanceProfile -InstanceProfileName ec2instancerole
```
**Ausgabe:**  

```
Arn                 : arn:aws:iam::123456789012:instance-profile/ec2instancerole
CreateDate          : 2/17/2015 2:49:04 PM
InstanceProfileId   : HH36PTZQJUR32EXAMPLE1
InstanceProfileName : ec2instancerole
Path                : /
Roles               : {ec2instancerole}
```
+  Einzelheiten zur API finden Sie unter [GetInstanceProfile AWS -Tools für PowerShell](https://docs.aws.amazon.com/powershell/v4/reference)*Cmdlet-Referenz (V4).* 

**Tools für V5 PowerShell **  
**Beispiel 1: In diesem Beispiel werden Details des genannten Instanzprofils zurückgegeben`ec2instancerole`, das im aktuellen AWS Konto definiert ist.**  

```
Get-IAMInstanceProfile -InstanceProfileName ec2instancerole
```
**Ausgabe:**  

```
Arn                 : arn:aws:iam::123456789012:instance-profile/ec2instancerole
CreateDate          : 2/17/2015 2:49:04 PM
InstanceProfileId   : HH36PTZQJUR32EXAMPLE1
InstanceProfileName : ec2instancerole
Path                : /
Roles               : {ec2instancerole}
```
+  Einzelheiten zur API finden Sie unter [GetInstanceProfile AWS -Tools für PowerShell](https://docs.aws.amazon.com/powershell/v5/reference)*Cmdlet-Referenz (V5*). 

------