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
# The following downloads an item from the media library in the master db and dynamically detects the file extension. | |
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://remotesitecore | |
Receive-MediaItem -Session $session -Path "/sitecore/media library/Images/Icons/accuracy" -Destination C:\Images\ -Force |
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
# The following uploads a single image with a new name to the specified path in the media library in the master db. | |
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://remotesitecore | |
Send-MediaItem -Session $session -Path C:\Images\banner.jpg -Destination "/sitecore/media library/Images/banner.jpg" |
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
$index="sitecore_master_index" | |
$props = @{ | |
Parameters = @( | |
@{ Name="Info"; Title="Index"; Value="The report will be based on $($index)."; editor="info" }, | |
@{ | |
Name="searchBaseTemplate" | |
Value="" | |
Title="Base Template" | |
Tooltip="Index the _basetemplates field as shown here on <a href='https://github.com/SitecorePowerShell/Console/issues/424' target='_blank'>Github</a>." |
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-Module -Name WebAdministration | |
$appPoolsPath = "IIS:\AppPools" | |
foreach($appPool in Get-ChildItem -Path $appPoolsPath) { | |
if($appPool.state -eq "Started") { | |
$processes = Get-ChildItem -Path "$($appPoolsPath)\$($appPool.Name)\WorkerProcesses" | |
foreach($process in $processes) { | |
[pscustomobject]@{ | |
"AppPool" = $appPool.Name |
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
$path = "master:\" | |
$identity = "admin" | |
$time1 = Measure-Command -Expression { | |
Get-ChildItem -Path $path -Recurse | Where-Object { $_.__lock -eq $identity } | |
} | |
$time2 = Measure-Command -Expression { | |
$query = "fast://*[@__lock='%$($identity)%']" | |
Get-Item -Path $Path -Query $query |
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
$VerbosePreference = "Continue" | |
$relpattern = "(<label>Release date:</label>\s*<span.*>(?<release>[0-9/:AMP\s]*)</span>)" | |
$revpattern = "(<label>Revision date:</label>\s*<span.*>(?<revision>[0-9/:AMP\s]*)</span>)" | |
function Get-PageContent { | |
param( | |
[string]$Link | |
) |
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
<# | |
.NOTES | |
Copied from Nick Wesselman's video https://www.youtube.com/watch?v=tXTbMRVF0ts | |
#> | |
function Start-Publish { | |
param( | |
[string]$Source = "master", | |
[string]$Target = "web" | |
) |
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
<# | |
.SYNOPSIS | |
Queries all pages on the site, excluding non-content items. | |
#> | |
# List of template ids to exclude from the count. | |
$templateIds = @( | |
"{29FD19B5-6F81-4829-B725-9C4279DA13CE}", | |
"{C3C9ED41-B476-49A9-B50C-FF8901665EA0}", | |
"{5A905A62-4898-44CE-96BA-EB3432BAAD91}", |
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
$path = "master:\content\" | |
$items = Get-ChildItem -Path $path -Recurse | |
$fields = @("Ads","Body","Carousel","HtmlText","Left Body","Location Body","Mid Body","Quick Links and News","Search Location") | |
$updateCounts = @{} | |
$fields | ForEach-Object { $updateCounts[$_] = 0 } | |
foreach($item in $items) { | |
Write-Host "Processing $($item.Id) : $($item.Name)" | |
foreach($field in $fields) { | |
if($item.$field) { |
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
Trace-Command -Name ParameterBinding -PSHost -Expression { | |
Get-Item -Path "master:\content\home" | |
} |