Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. ItemName Title Icon ...
  2. Blog1 Blog1 G:ImageBlog1.jpg
  3. Blog2 Blog2 G:ImageBlog2.jpg
  4. Blog3 Blog3 G:ImageBlog3.jpg
  5.  
  6. try
  7. {
  8.  
  9. foreach($record in $csv)
  10. {
  11. $path = "/sitecore/content/COM/Home/Blogs"
  12.  
  13.  
  14. $item = New-Item -Path $path -Name $record.ItemName -ItemType $record.Templates
  15.  
  16. $item.Editing.BeginEdit()
  17. $item["ItemName"] = $record.ItemName
  18. $item["Title"] = $record.PageTitle
  19.  
  20. #add other mappings ...
  21.  
  22. $item.Editing.EndEdit()
  23.  
  24. Write-Host "Item created: " $record.ItemName
  25.  
  26. }
  27.  
  28. }
  29. finally
  30. {
  31. $bulk.Dispose()
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement