Creating and Removing Items
Creating Items
Basic Item Creation
$itemPath = "master:\content\home\Sample Item 3"
New-Item -Path $itemPath -ItemType "Sample/Sample Item"
Name Children Language Version Id TemplateName
---- -------- -------- ------- -- ------------
Sample Item 3 False en 1 {29A68114-5137-4A46-A87C-3789B8D898FB} Sample Item$itemPath = "master:\content\home\Sample Item 4"
$templateId = "{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}"
New-Item -Path $itemPath -ItemType $templateIdCreating Items with Specific IDs
Creating Items as Children
Creating Items in Specific Languages
Starting Workflows
Setting Field Values During Creation
Bulk Item Creation
Pattern: Create Items from CSV
Pattern: Create Items with Progress Reporting
Pattern: Create Hierarchical Structure
Pattern: Create Items from JSON
Removing Items
Basic Item Removal
Removing Items via Pipeline
Bulk Removal Patterns
Pattern: Remove Old Items
Pattern: Remove Items by Template
Pattern: Clean Up Empty Folders
Pattern: Remove with Confirmation
Pattern: Safe Removal with Reporting
Dynamic Parameters
Parameter
Command
Description
Example
Item Naming Considerations
Valid Item Names
Invalid Characters
Error Handling
Pattern: Create with Error Handling
Pattern: Bulk Create with Error Logging
Performance Tips
See Also
References
Last updated