This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem master:\templates\ -recurse |? {$_.TemplateName -eq "Template Field" -and $_._Source -ne "" } | ft ProviderPath, _Source -auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$item = get-item master:\content\Demo\Int\Presentation\Designs | |
$parent = get-item . |% { $_.Parent } | |
$result = Read-Variable -Parameters ` | |
@{ Name = "from"; Value=[System.DateTime]::Now.AddDays(-5); Title="Start Date"; Tooltip="Date since when you want the report to run"; ShowTime=$true}, ` | |
@{ Name = "item"; Title="Start Item"; Root="/sitecore/content/"; Tooltip="Branch you want to analyse."}, ` | |
@{ Variable = get-variable "parent" }, ` | |
@{ Name = "silent"; Value=$true; Title="Proceed Silently"; Tooltip="Check this is you don't want to be interrupted"; }, ` | |
@{ Name = "someText"; Value="Some Text"; Title="Text"; Tooltip="Tooltip for singleline"; }, ` | |
@{ Name = "someMultilineText"; Value="Multiline Text"; Title="Text"; lines=3; Tooltip="Tooltip for multiline"; }, ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#item I want to set the field on | |
$item = get-item "master:/content/home" | |
#image I want to use | |
$image = new-object -TypeName "Sitecore.Data.Items.MediaItem" -ArgumentList (get-item "master:/media library/Showcase/cognifide_logo") | |
#field I want to set on $item | |
$imageField = [Sitecore.Data.Fields.ImageField]$item.Fields["image"]; | |
$item.Editing.BeginEdit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$item = get-item master:/content/home | |
$item.Image = get-item "master:/media library/Showcase/cognifide_logo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$item = get-item master:\content\Demo\Int\Home | |
$device =Get-Device -Default | |
$contentDataSource = get-item master:\content\Demo\Int\Home\about-us\employee-stories\adam-najmanowicz | |
$ImageDataSource = get-item master:\content\Demo\Int\Data\Images\d56cf7e777a2496aa6489a7bffc03539 | |
$rendering = get-item master:\layout\Sublayouts\ZenGarden\Basic\Content | |
Add-Rendering -Item $item -Device $device -Rendering $rendering -Placeholder main -Parameter @{FieldName ="Title"} -DataSource $contentDataSource | |
$rendering = get-item master:\layout\Sublayouts\ZenGarden\Basic\Image | |
Add-Rendering -Item $item -Device $device -Rendering $rendering -Placeholder main -DataSource $ImageDataSource | |
$rendering = get-item master:\layout\Sublayouts\ZenGarden\Basic\Subtitle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Function Resolve-Error | |
#Show-FieldEditor -Item (gi master:\content\cognifidecom\int\settings) -PreserveSections -Width 500 -Height 500 -title "Zen Garden Site settings" | |
$content = gi master:\layout\Sublayouts\ZenGarden\Basic\Content | New-Rendering -Placeholder "main" | |
$item = gi master:\content\Demo\Int\Home | |
<#Add-Rendering -Item $item -PlaceHolder "main" -Rendering $content -Parameter @{ FieldName = "Content" } | |
Add-Rendering -Item $item -PlaceHolder "main" -Rendering $content -Parameter @{ FieldName = "SummaryText" } | |
Add-Rendering -Item $item -PlaceHolder "main" -Rendering $content -Parameter @{ FieldName = "SummaryIcon" } | |
#> | |
#$renderings = $item | Get-Rendering -Placeholder "main" | |
foreach ($rendering in $Renderings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$DocumentationFolder = "C:\Projects\sitecorepowershell\Trunk\Documentation" | |
$documented = Get-ChildItem $DocumentationFolder | % { $_.BaseName } | |
$undocumented = get-command | ? { $_.DLL -match "Cognifide"} | ? { "$($_.Verb)-$($_.Noun)" -Notin $documented } | %{ "$($_.Verb)-$($_.Noun)" } | |
$undocumented | % { | |
$fileName = "$DocumentationFolder\$_.TODO.ps1" | |
if(Test-Path $fileName){ | |
remove-item $filename | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clear test items: | |
# Get-ChildItem 'master:\system\Modules\PowerShell\Script Library' -recurse | Where-Object { ($_.Name -match '\(test\)') } | Remove-Item | |
$package = new-package "Sitecore PowerShell Extensions"; | |
$package.Sources.Clear(); | |
$package.Metadata.Author = "Adam Najmanowicz - Cognifide, Michael West"; | |
$package.Metadata.Publisher = "Cognifide Limited"; | |
$package.Metadata.Version = "2.6"; | |
$package.Metadata.Readme = 'This module provides 2 immediately usable interfaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Item templates | |
Get-Item 'master:\templates\Modules\PowerShell Console' | Serialize-Item -Recurse | |
Get-Item 'core:\templates\Modules\PowerShell Console' | Serialize-Item -Recurse | |
# Module Root | |
Get-Item 'master:\system\Modules\PowerShell' | Serialize-Item | |
Get-Item 'core:\system\Modules\PowerShell' | Serialize-Item | |
# Colors | |
Get-Item 'master:\system\Modules\PowerShell\Console Colors' | Serialize-Item -Recurse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$items = Get-Command * -CommandType Cmdlet | ? {$_.ModuleName -eq "" } | %{ Get-Help -Name ($_.Name) } | sort-object name | |
$props = @{ | |
InfoTitle = "Sitecore PowerShell Commands" | |
InfoDescription = "Lists the sitecore power shell commands" | |
PageSize = 25 | |
} | |
$items | Show-ListView @props -Property @{Label="Name"; Expression={$_.Name} }, @{Label="Synopsis"; Expression={$_.Synopsis} } |
OlderNewer