Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get Site Dictionary Domain Script (SXA Add Dictionary Script #2)
function Get-DictionaryDomain {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true, ValueFromPipeline = $true, Position=0 )]
[Item]$Root
)
begin {
Import-Function Test-ItemIsDictionaryDomain
Write-Verbose "Cmdlet Get-DictionaryDomain - Begin"
}
process {
Write-Verbose "Cmdlet Get-DictionaryDomain - Process"
Get-ChildItem -Path $Root.Paths.Path -Recurse | ? { (Test-ItemIsDictionaryDomain $_ ) -eq $true } | Select-Object -First 1
}
end {
Write-Verbose "Cmdlet Get-DictionaryDomain - End"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment