Skip to content

Instantly share code, notes, and snippets.

@burki169
Created May 30, 2022 19:13
Show Gist options
  • Save burki169/9f075b473ce0e36aa5ee59117e388440 to your computer and use it in GitHub Desktop.
Save burki169/9f075b473ce0e36aa5ee59117e388440 to your computer and use it in GitHub Desktop.
Sitecore Items Without a Language Version
$props = @{
Parameters = @(
@{Name="rootItem"; Title="Root Item"; editor="droptree"; Root="/sitecore/"})
Title = "Choose Root Item"
Description = ""
Width = 400
Height = 200
ShowHints = $true
}
Read-Variable @props > $null
if ($rootItem -ne $null -and ![string]::IsNullOrEmpty($rootItem.ItemPath))
{
$items = Get-ChildItem -Path $rootItem.ItemPath -Recurse | Where-Object {
$_.Versions.GetVersions($true).Count -eq 0 } |`
%{
[PSCustomObject]@{
"ID" = $_.ID
"ItemName" = $_.Name
"Item" = $_
"ItemPath" = $_.Paths.Path
}
}
$dlgProps = @{
Title = "Items with no version"
PageSize = 25
}
$items | Show-ListView @dlgProps -Property @{Label="Icon"; Expression={$_.__Icon} }, @{Label="Path"; Expression={$_.ItemPath} }
Close-Window
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment