Private/Get-GhostSiteUrl.ps1
|
function Get-GhostSiteUrl { <# .SYNOPSIS Returns the addresses of the site that the module is connected to. .DESCRIPTION A site can have two addresses. The first is the one the site reports for itself, which Ghost writes in every link to a page of the site. The second is the one Connect-Ghost was given. They differ for a site that is reached at a ghost.io address and answers with a domain of its own. Sync-GhostPost, Sync-GhostPage, Export-GhostPost and Export-GhostPage pass these addresses to Test-GhostSiteLinkMatch, to compare a link without the address of the site with the link that the site gives back. Returns nothing without a connection. .EXAMPLE Get-GhostSiteUrl Returns https://www.example.org/ and https://example.ghost.io for a site that was connected to at the second address and reports the first. #> [CmdletBinding()] [OutputType([string])] param() $connection = $script:GhostConnection if (-not $connection) { return } $connection['SiteUrl'], $connection['Url'] | Where-Object { $_ } | Select-Object -Unique } |