Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add url examples to the book. #12

Open
michaellwest opened this issue Aug 16, 2017 · 1 comment
Open

Add url examples to the book. #12

michaellwest opened this issue Aug 16, 2017 · 1 comment
Assignees

Comments

@michaellwest
Copy link
Member

michaellwest commented Aug 16, 2017

$site = [Sitecore.Sites.SiteContextFactory]::GetSiteContext("usa")
$url = New-UsingBlock (New-Object Sitecore.Sites.SiteContextSwitcher $site) {
    $pageItem = Get-Item -Path "master:" -Id "{50BE527C-7241-4613-A7A9-20D0217B264B}"
    [Sitecore.Links.LinkManager]::GetItemUrl($pageItem)
}

$url = New-UsingBlock (New-Object Sitecore.Sites.SiteContextSwitcher $site) {
    $mediaItem = Get-Item -Path "master:" -Id "{CBE06C33-59DE-4B34-968D-19EBA886BC84}"
    [Sitecore.Resources.Media.MediaManager]::GetMediaUrl($mediaItem)
}
@michaellwest
Copy link
Member Author

Updated with page url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant