Skip to content

Instantly share code, notes, and snippets.

View Brad-Christie's full-sized avatar

Brad Christie Brad-Christie

View GitHub Profile
@Brad-Christie
Brad-Christie / README.md
Last active August 8, 2019 18:56
Renaming Sitecore Installation (9.2)

Renaming Sitecore Instance Post-Install

  1. Stop IIS
  2. Stop the following services:
@Brad-Christie
Brad-Christie / OpenWithDocker.reg
Last active July 25, 2019 12:07
Open with Docker (Right-Click Context Menu)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Docker]
@="Open with Docker"
"Icon"="C:\\Program Files\\Docker\\Docker\\resources\\ddvp.ico"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Docker\command]
@="cmd /c docker.exe run -it --rm --volume \"%V:C:\\host\" --workdir \"C:\\host\" --entrypoint \"powershell.exe\" \"mcr.microsoft.com/windows/servercore:ltsc2019\""
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Docker]
@="Open with Docker"
"Icon"="C:\\Program Files\\Docker\\Docker\\resources\\ddvp.ico"
@Brad-Christie
Brad-Christie / solr.sh
Created July 23, 2019 19:39
Install SOLR on WSL
#!/bin/sh
wget https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
wget https://archive.apache.org/dist/lucene/solr/7.5.0/solr-7.5.0.tgz
tar xzf ./openjdk-12.0.2_linux-x64_bin.tar.gz -C /usr/local/jdk-12.0.2/
tar xzf ./solr-7.5.0.tgz -C /usr/local/solr-7.5.0/
sudo nano /usr/local/solr-7.5.0/bin/solr.in.sh
# SET SOLR_JAVA_HOME="/usr/local/jdk-12.0.2" ]
@Brad-Christie
Brad-Christie / Backup-Sitecore.ps1
Last active July 18, 2019 11:35
Backup Sitecore Instance (Single Developer Only)
Function GetDatabases {
[CmdletBinding()]
Param(
[Parameter(Position = 0, Mandatory, ValueFromPipeline)]
[ValidateScript({ Test-Path $_ -PathType "Container" })]
[string]$WebRoot
)
Process {
$Databases = @()
@Brad-Christie
Brad-Christie / Install-SolrWebApp.ps1
Created July 9, 2019 20:22
Uses PowerShell Az module to deploy SOLR as a WebApp
[CmdletBinding()]
Param(
[Parameter()]
[guid]$SubscriptionId = "16a1fd8b-1684-4b0f-9c72-383d91e35cd7"
,
[Parameter()]
[ValidateSet("Canada Central","Canada East","Central US","East US","East US 2","North Central US","South Central US","West Central US","West US","West US 2")]
[string]$Region = "Central US"
,
[Parameter()]
@Brad-Christie
Brad-Christie / Azure-Docker.ps1
Created July 3, 2019 22:37
Build a docker base image that allows you to run Azure commands against your subscription
[CmdletBinding()]
Param(
[Parameter()]
[string]$SubscriptionId = $null
,
[Parameter()]
[string]$CertificatePassword = "secret"
,
[Parameter()]
[ValidateScript({ Test-Path $_ -IsValid })]
@Brad-Christie
Brad-Christie / sitecore-packages.json
Created May 16, 2019 00:53
Associative list of sitecore package TO direct download URL (assuming authentication)
{
"Sitecore 8.2 rev. 161221.zip": {
"description": "Sitecore Experience Platform 8.2 Update-2",
"url": "https://dev.sitecore.net/~/media/02D2B5F95D1D4B1F894C2E3CA1194E45.ashx"
},
"Sitecore 8.2 rev. 171121 (WDP XP0 package).zip": {
"description": "Sitecore Experience Platform 8.2 Update-6",
"url": "https://dev.sitecore.net/~/media/AFA4C05BA4414C239FA9945E52ABF7DC.ashx"
},
"Sitecore 8.2 rev. 180406 (WDP XP1 packages).zip": {
@Brad-Christie
Brad-Christie / Format-[Un]SafeString.ps1
Created May 16, 2019 00:47
How to parse and format a string with placeholders, and only bring in the tokens you want.
$Make = "Tesla"
$Model = "X"
$Year = 2017
$Format = "`$Year `$Make `$Model"
Function Format-UnsafeString {
Param(
[Parameter(Position = 0, Mandatory)]
[string]$Format
,
@Brad-Christie
Brad-Christie / Test-Property.Tests.ps1
Created December 28, 2018 17:34
Test if a property exists on object
. "${PSScriptRoot}\Test-Property.ps1"
Describe "Test-Property" {
Context "Basic Usage" {
BeforeAll {
$obj = @{ Foo = "Bar" }
}
It "Should accept named parameters" {
Test-Property -InputObject $obj -PropertyName "Foo" | Should -Be $true
}
@Brad-Christie
Brad-Christie / README.md
Last active December 14, 2018 17:38
BrickLink - The LEGO Christmas Ornaments Book (by Chis McVeigh)