AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Get-IAMPolicyVersion-PolicyArn <String>-VersionId <String>-Select <String>-ClientConfig <AmazonIdentityManagementServiceConfig>
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Required? | True |
| Position? | 2 |
| Accept pipeline input? | True (ByPropertyName) |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Required? | True |
| Position? | 3 |
| Accept pipeline input? | True (ByPropertyName) |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Aliases | AK |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByValue, ByPropertyName) |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByValue, ByPropertyName) |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Aliases | AWSProfilesLocation, ProfilesLocation |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Aliases | StoredCredentials, AWSProfileName |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Aliases | RegionToCall |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Aliases | SK, SecretAccessKey |
| Required? | False |
| Position? | Named |
| Accept pipeline input? | True (ByPropertyName) |
| Aliases | ST |
$results = Get-IAMPolicyVersion -PolicyArn arn:aws:iam::123456789012:policy/MyManagedPolicy -VersionId v2
$results
CreateDate Document IsDefaultVersion VersionId
---------- -------- ---------------- ---------
2/12/2015 9:39:53 AM %7B%0A%20%20%22Version%22%3A%20%222012-10... True v2
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility")
$policy = [System.Web.HttpUtility]::UrlDecode($results.Document)
$policy
{
"Version": "2012-10-17",
"Statement":
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances"
],
"Resource": [
"arn:aws:ec2:us-east-1:555555555555:instance/i-b188560f"
]
}
}This example returns the policy document for thev2version of the policy whose ARN isarn:aws:iam::123456789012:policy/MyManagedPolicy. The policy document in theDocumentproperty is URL encoded and is decoded in this example with theUrlDecode.NET method.
AWS Tools for PowerShell: 2.x.y.z