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
$property = @( | |
@{Name='Email';Expression={ $PSItem.Profile.GetCustomProperty('Email') }}, | |
@{Name='FirstName';Expression={ $PSItem.Profile.GetCustomProperty('FirstName') }}, | |
@{Name='LastName';Expression={ $PSItem.Profile.GetCustomProperty('LastName') }}, | |
@{Name='Title';Expression={ $PSItem.Profile.GetCustomProperty('Title') }}, | |
@{Name='Company';Expression={ $PSItem.Profile.GetCustomProperty('Company') }}, | |
@{Name='Country';Expression={ $PSItem.Profile.GetCustomProperty('Country') }}, | |
@{Name='ZipCode';Expression={ $PSItem.Profile.GetCustomProperty('ZipCode') }}, | |
@{Name='Department';Expression={ $PSItem.Profile.GetCustomProperty('Department') }}, | |
@{Name='Street';Expression={ $PSItem.Profile.GetCustomProperty('Street') }}, |
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
function Get-DefaultSpeConfig() | |
{ | |
# $AppPath is SPE console variable, see Variables on https://doc.sitecorepowershell.com/interfaces.html | |
if( $AppPath -ne $null ) | |
{ | |
return Join-Path -Path $AppPath -ChildPath "App_Config\Include\Cognifide.PowerShell.config" | |
} | |
} | |
function Set-UAC4SPE |
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 to Sitecore root folder not website folder | |
$webPath = "B:\Sitecore 8.2 rev. 160729\" | |
$csvPath = "B:\Sitecore 8.2 rev. 160729\Website\App_Config\Config Enable-Disable Sitecore_8.2 Update1.csv" | |
# Use -WhatIf -Verbose options for the first time | |
Set-SitecoreEnvironment -WebPath $webPath -CsvPath $csvPath -Search Solr -Environment ContentManagement -Backup | |
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
#https://bitbucket.org/sitecoreautomationteam/sitecore-automation/wiki/Home | |
#https://www.powershellgallery.com/packages/sitecore-automation/0.9 | |
Import-Module sitecore-automation -force | |
# This file must exist | |
$devhosts = 'C:\Users\user\Desktop\dev.hosts' | |
# Path to config files | |
$webPath = 'E:\www\MyProject\Website\App_Config\Include\' |
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 sitecore-automation -force | |
$AppConfig = "$AppPath\App_Config\Include\" | |
$hosts = Get-SitecoreSites -Path $AppConfig | Select-Object -ExpandProperty hostName | ` | |
Show-ListView -Property @{Label="Login"; Expression={ "<a href='http://" + $_ + "/sitecore/login'>" + $_ + "</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
<# | |
.SYNOPSIS | |
The synopsis goes here. This can be one line, or many. | |
.DESCRIPTION | |
The description is usually a longer, more detailed explanation of what the script or function does. Take as many lines as you need. | |
.PARAMETER computername | |
Here, the dotted keyword is followed by a single parameter name. Don't precede that with a hyphen. The following lines describe the purpose of the parameter: |
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
-- Change [bucket] with your bucket name | |
exec msdb.dbo.rds_restore_database | |
@restore_db_name='Sitecore_Analytics', | |
@s3_arn_to_restore_from='arn:aws:s3:::[bucket]/Sitecore_Analytics.bak'; | |
exec msdb.dbo.rds_restore_database | |
@restore_db_name='Sitecore_Core', | |
@s3_arn_to_restore_from='arn:aws:s3:::[bucket]/Sitecore_Core.bak'; |
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
$webpath = 'E:\www\Sitecore8\Website\Web.config' | |
#var addElement = handlersCollection.CreateNewElement("add"); | |
#addElement.Properties.Item("name").Value = "PHP-FastCGI"; | |
[xml]$XmlDocument = Get-Content -Path $webpath | |
$handler = $XmlDocument.configuration.'system.webServer'.handlers.ChildNodes | Where-Object {$_.Name -eq 'CaptchaImage'} | |
if( $handler -eq $null ) |
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
function Create-Item | |
{ | |
<# | |
.SYNOPSIS | |
Creates a new item only when an item not exsit. | |
#> | |
[cmdletbinding()] | |
Param( | |
[Parameter(Mandatory)] | |
$Path, |
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
cd 'master:/sitecore/media library' | |
function AddPathMember($item) | |
{ | |
$path = $item.Paths.Path; | |
$item | Add-Member -MemberType NoteProperty -Name Path -Value $path; | |
return $item | |
} | |
Get-ChildItem -Recurse . | Where-Object { $_.Size -eq 0 } | |
NewerOlder