Skip to content

Instantly share code, notes, and snippets.

@ankitjoshi
Last active May 29, 2021 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitjoshi/de5b99648c70f62956f6025d36acaf2b to your computer and use it in GitHub Desktop.
Save ankitjoshi/de5b99648c70f62956f6025d36acaf2b to your computer and use it in GitHub Desktop.
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