I am running a script in Sitecore powershell to find items bases on a regular expression on a custom field ('Subkey'). This script sometimes shows results and sometimes shows 'No items available'.
Why is this not consistent? And how is this possible? I am running this within the Sitecore ISE
Write-Host "Begin script"
function Get-InvalidKeysAndSubkeys {
#param([string]$label)
Get-ChildItem -Recurse | Where-Object {
(
((![string]::IsNullOrEmpty($_.Subkey)) -and ($_.Subkey -match "[^a-zA-Z0-9$ \-_\.!'()]"))
)
}
}
$x = Get-InvalidKeysAndSubkeys
$x | Show-ListView -Property Name,Key,SubKey,Id,ItemPath
Write-Host "End script"