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
# ======================================================================================================== | |
# SEE END OF FILE FOR EXAMPLE USAGE AND COMMAND THAT WILL BE EXECUTED! | |
# ======================================================================================================== | |
Function Process-Site-Definitions-Url([string]$xmlUrl, [boolean]$overwrite = $false, [boolean]$removeSite = $false) | |
{ | |
# GETS CONTENTS OF WEB-HOSTED XML FILE, COPIES THEM TO A TEMPORARY FILE, PROCESSES FILE USING Process-Site-Definitions, AND THEN REMOVES THE TEMPORARY FILE | |
Import-Module WebAdministration; | |
[DateTime]$date = Get-Date; # GET CURRENT DATE | |
[string]$xmlPath = "$env:TEMP\site_definitions_" + $date.ToString("yyyyMMdd") + ".xml"; # SET THE PATH FOR THE LOCAL COPY OF THE XML FILE, IN THE USERS "TEMP" FOLDER |
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 QuickWebsiteDeployment([string]$SiteName = "Default Website", [string]$SitePath = 'D:\InetSrv\wwwroot', [string]$SiteUrl = 'http://localhost/', [boolean]$suppressRollbackWarning = $false) | |
{ | |
# Check to see if production folder exists. If it doesn't exist, exit with errors... | |
$ProductionPathExists = Test-Path $SitePath; | |
if ($ProductionPathExists -eq $true) | |
{ | |
# Check to see if '-Offline' folder exists, if it doesn't we will create it for next time by copying the current production folder and ACLs to a new '-Offline' folder. | |
$OfflinePathExists = Test-Path $SitePath'-Offline'; | |
if ($OfflinePathExists -eq $false) | |
{ |
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
# === BEGIN EXAMPLE USAGE ============================================================================== | |
# Unblock-Files -path "C:\InetPub\wwwroot" | |
# === END EXAMPLE USAGE ================================================================================ | |
Function Unblock-Files([string]$path = "C:\") | |
{ | |
$folders = dir $path -recurse | Where {$_.PSIsContainer}; | |
foreach($folder in $folders) | |
{ | |
Get-ChildItem $folder.FullName | Unblock-File -Verbose; |
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
using Sitecore.Data; | |
using Sitecore.Data.Items; | |
using Sitecore.Globalization; | |
using Sitecore.Pipelines.GetTranslation; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace Sitecore.Web.Pipelines | |
{ | |
public class DictionaryFallback |
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 Excel file containing the list of URLs | |
$inputFile = "C:\Temp\Input.xlsx" | |
# The Excel file where output should be saved to | |
$outputFile = "C:\Temp\Output.xlsx" | |
# If the page contains the following pattern, it will also be considered a 404 error (in addition to pages that actually return a status of 404). | |
$patternOfFailure = "*Oops! We couldn't find this page.*" | |
# Name of worksheet |
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
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<!-- RULE BEGINS HERE --> | |
<rule name="HTTP to HTTPS Redirect" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> | |
</conditions> |
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
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<!-- RULE BEGINS HERE --> | |
<rule name="Old Domain Redirection" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="true"> | |
<add input="{HTTP_HOST}" pattern="(.*)olddomain.com" /> | |
</conditions> |
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
USE Sample; | |
GO | |
IF NOT EXISTS | |
(SELECT * FROM sys.symmetric_keys WHERE symmetric_key_id = 101) | |
CREATE MASTER KEY ENCRYPTION BY | |
PASSWORD = 'nYRj7R!@@_^w!y}TS!wRu-%BF7`!3`z)mSGF`E+;Ju==rcr;_nvtQaHtS2NqPk' | |
GO | |
CREATE CERTIFICATE Field_Level_Data_Encryption_Certificate |
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
<!-- Under coveo/defaultIndexConfiguration/fieldMap/fieldNames add the following --> | |
<fieldType fieldName="FileAttachmentContents" includeForFreeTextSearch="true" isDisplayField="true" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" /> | |
<!-- Under coveo/defaultIndexConfiguration/documentOptions/fields add the following (adjust the namespace accordingly) --> | |
<field fieldName="FileAttachmentContents">Search.FileAttachmentContents, Search</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
$input = 'C:\input'; | |
$output = 'C:\file-list.txt'; | |
$files = Get-ChildItem $input -Recurse; | |
foreach ($file in $files){ | |
$fullName = $file.FullName; | |
$lastWriteTime = $file.LastWriteTime; | |
Write-Output "$fullName`t$lastWriteTime" | Out-File -FilePath $output -Append | |
} |
OlderNewer