Skip to content

Instantly share code, notes, and snippets.

View patelcp's full-sized avatar

Chirag Patel patelcp

View GitHub Profile
# A BoxStarter script for use with http://boxstarter.org/WebLauncher
# Updates a Windows machine and installs a range of developer tools
# Allow unattended reboots
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$false
$Boxstarter.AutoLogin=$true
$checkpointPrefix = 'BoxStarter:Checkpoint:'
@patelcp
patelcp / TestBoxstarterNPM.ps1
Last active March 22, 2017 06:10
Boxstarter Tests
# Allow unattended reboots
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$false
$Boxstarter.AutoLogin=$true
choco install nodejs.install --limitoutput
refreshenv
npm install -g gulp-cli
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <settings>
      <setting name="Xdb.Enabled">
        <patch:attribute name="value">false</patch:attribute>
      </setting>
      <setting name="Xdb.Tracking.Enabled">
        <patch:attribute name="value">false</patch:attribute>
      </setting>
    </settings>
@patelcp
patelcp / DeviceDetection.disable.config
Last active October 21, 2020 16:52
Sitecore Fix: WARNING Authentication on CES Discovery service failed.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <settings>
      <setting name="DeviceDetection.Enabled">
        <patch:attribute name="value">false</patch:attribute>
      </setting>
    </settings>
  </sitecore>
</configuration>
@patelcp
patelcp / import.ps1
Created December 29, 2017 21:08 — forked from pveller/import.ps1
Sitecore Content Import with Powershell
# http://jockstothecore.com/content-import-with-powershell-treasure-hunt
function NormalizeName($name)
{
# replace all special symbols with single spaces
$name = $name -replace "[^a-zA-Z0-9]", " " -replace "\s+", ""
return $name.Trim()
}
@patelcp
patelcp / Renderings.ps1
Created December 29, 2017 21:12 — forked from AdamNaj/Renderings.ps1
Rendering manipulation in PowerShell for Sitecore
$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
@patelcp
patelcp / ImportWizardFromCSV.ps1
Created December 29, 2017 21:13 — forked from michaellwest/ImportWizardFromCSV.ps1
Import content from a CSV using Sitecore PowerShell Extensions.
<#
.SYNOPSIS
Data Import Wizard provides a way to generate or update content from an external file.
.DESCRIPTION
The import file uses the properties "Name" and "Id" to help match existing items.
.NOTES
Requires Sitecore PowerShell Extensions 4.6 or newer.
<#
Author(s): Bruce Lee, Grant Killian, Kelly Rusk, Jimmy Rudley
Created Date: August 4, 2016
Modified Date: May 3, 2017
This is the Rackspace Managed Services for Sitecore (https://www.rackspace.com/digital/sitecore) script for security hardening a Sitecore environment
If the Execution Policy does not allow execution, you may need to run the following interactively to allow a scoped session bypass.
This is secure as it requires interaction on server and cannot be executed from a script:
@patelcp
patelcp / RebuildSearchIndexesWithProgress.ps1
Created December 29, 2017 21:27 — forked from michaellwest/RebuildSearchIndexesWithProgress.ps1
Rebuild all of the Sitecore content search indexes with a progress dialog.
Get-SearchIndex | Rebuild-SearchIndex -IncludeRemoteIndex
$jobs = [Sitecore.Jobs.JobManager]::GetJobs() | Where-Object { !$_.IsDone -and $_.Category -eq "Indexing" } | Sort-Object -Property Name
$jobsCount = $jobs.Count
while(($jobs | Where-Object { !$_.IsDone })) {
$progressCount = 0
$message = New-Object System.Text.StringBuilder
foreach($job in $jobs) {
$message.AppendLine("$($job.Name) is $($job.Status.State) and processed: $($job.Status.Processed)") | Out-Null
@patelcp
patelcp / RemotelyDownloadFile.ps1
Created December 29, 2017 21:27 — forked from michaellwest/RemotelyDownloadFile.ps1
Read all bytes of a file from the Sitecore PowerShell Extensions remoting service.
Import-Module -Name SPE
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://console
$bytes = Invoke-RemoteScript -Session $session -ScriptBlock {
[System.IO.File]::ReadAllBytes("$($SitecoreDataFolder)packages\SPE Remoting-3.1.zip")
}
[System.IO.File]::WriteAllBytes("C:\temp\SPE Remoting-3.1.zip", $bytes)