AWS Security ChangesHomeSearch

AWS code-library documentation change

Service: code-library · 2025-06-28 · Documentation low

File: code-library/latest/ug/iam_example_iam_ListPolicies_section.md

Summary

Added PowerShell V5 examples for listing managed policies with scope filtering

Security assessment

Shows how to audit IAM policies (a security feature), but does not fix vulnerabilities. Helps users distinguish between AWS-managed and customer-managed policies.

Diff

diff --git a/code-library/latest/ug/iam_example_iam_ListPolicies_section.md b/code-library/latest/ug/iam_example_iam_ListPolicies_section.md
index 129c8d814..e9d481515 100644
--- a//code-library/latest/ug/iam_example_iam_ListPolicies_section.md
+++ b//code-library/latest/ug/iam_example_iam_ListPolicies_section.md
@@ -414,0 +415,81 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example returns a collection of the first three managed policies available in the current AWS account. Because`-scope` is not specified, it defaults to `all` and includes both AWS managed and customer managed policies.**
+    
+    
+    Get-IAMPolicyList -MaxItem 3
+    
+
+**Output:**
+    
+    
+    Arn              : arn:aws:iam::aws:policy/AWSDirectConnectReadOnlyAccess
+    AttachmentCount  : 0
+    CreateDate       : 2/6/2015 10:40:08 AM
+    DefaultVersionId : v1
+    Description      : 
+    IsAttachable     : True
+    Path             : /
+    PolicyId         : Z27SI6FQMGNQ2EXAMPLE1
+    PolicyName       : AWSDirectConnectReadOnlyAccess
+    UpdateDate       : 2/6/2015 10:40:08 AM
+          
+    Arn              : arn:aws:iam::aws:policy/AmazonGlacierReadOnlyAccess
+    AttachmentCount  : 0
+    CreateDate       : 2/6/2015 10:40:27 AM
+    DefaultVersionId : v1
+    Description      : 
+    IsAttachable     : True
+    Path             : /
+    PolicyId         : NJKMU274MET4EEXAMPLE2
+    PolicyName       : AmazonGlacierReadOnlyAccess
+    UpdateDate       : 2/6/2015 10:40:27 AM
+          
+    Arn              : arn:aws:iam::aws:policy/AWSMarketplaceFullAccess
+    AttachmentCount  : 0
+    CreateDate       : 2/11/2015 9:21:45 AM
+    DefaultVersionId : v1
+    Description      : 
+    IsAttachable     : True
+    Path             : /
+    PolicyId         : 5ULJSO2FYVPYGEXAMPLE3
+    PolicyName       : AWSMarketplaceFullAccess
+    UpdateDate       : 2/11/2015 9:21:45 AM
+
+**Example 2: This example returns a collection of the first two customer managed policies available in current AWS account. It uses`-Scope local` to limit the output to only customer managed policies. **
+    
+    
+    Get-IAMPolicyList -Scope local -MaxItem 2
+    
+
+**Output:**
+    
+    
+    Arn              : arn:aws:iam::123456789012:policy/MyLocalPolicy
+    AttachmentCount  : 0
+    CreateDate       : 2/12/2015 9:39:09 AM
+    DefaultVersionId : v2
+    Description      : 
+    IsAttachable     : True
+    Path             : /
+    PolicyId         : SQVCBLC4VAOUCEXAMPLE4
+    PolicyName       : MyLocalPolicy
+    UpdateDate       : 2/12/2015 9:39:53 AM
+    
+    Arn              : arn:aws:iam::123456789012:policy/policyforec2instancerole
+    AttachmentCount  : 1
+    CreateDate       : 2/17/2015 2:51:38 PM
+    DefaultVersionId : v11
+    Description      : 
+    IsAttachable     : True
+    Path             : /
+    PolicyId         : X5JPBLJH2Z2SOEXAMPLE5
+    PolicyName       : policyforec2instancerole
+    UpdateDate       : 2/18/2015 8:52:31 AM
+
+  * For API details, see [ListPolicies](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+