AWS Security ChangesHomeSearch

AWS code-library documentation change

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

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

Summary

Added PowerShell V5 example for policy version management

Security assessment

Routine documentation about policy versioning workflow. No specific security implications mentioned.

Diff

diff --git a/code-library/latest/ug/iam_example_iam_CreatePolicyVersion_section.md b/code-library/latest/ug/iam_example_iam_CreatePolicyVersion_section.md
index 65af49e43..5f5d54416 100644
--- a//code-library/latest/ug/iam_example_iam_CreatePolicyVersion_section.md
+++ b//code-library/latest/ug/iam_example_iam_CreatePolicyVersion_section.md
@@ -76,0 +77,21 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example creates a new "v2" version of the IAM policy whose ARN is`arn:aws:iam::123456789012:policy/MyPolicy` and makes it the default version. The `NewPolicyVersion.json` file provides the policy content. Note that you must use the `-Raw` switch parameter to successfully process the JSON policy file.**
+    
+    
+    New-IAMPolicyVersion -PolicyArn arn:aws:iam::123456789012:policy/MyPolicy -PolicyDocument (Get-content -Raw NewPolicyVersion.json) -SetAsDefault $true
+    
+
+**Output:**
+    
+    
+    CreateDate                           Document                  IsDefaultVersion             VersionId
+    ----------                           --------                  ----------------             ---------
+    4/15/2015 10:54:54 AM                                          True                         v2
+
+  * For API details, see [CreatePolicyVersion](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+