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
$item = Get-Item master:/content/home | |
$newTemplate = [Sitecore.Configuration.Factory]::GetDatabase("master").Templates["Sample/Sample Item"]; | |
$item.ChangeTemplate($newTemplate) |
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
$response = Show-ModalDialog -HandleParameters @{ | |
"h"="Create an Anti-Package"; | |
"t" = "Select a package that needs an anti-package"; | |
"ic"="People/16x16/box.png"; | |
"ok"="Pick"; | |
"ask"=""; | |
"path"= "packPath:$SitecorePackageFolder"; | |
"mask"="*.zip"; | |
} -Control "Installer.Browse" |
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 System.Diagnostics; | |
using System.Web.Mvc; | |
namespace YourApp.Web.Infrastructure.Filters | |
{ | |
/// <summary> | |
/// Filter to display the execution time of both the action and result | |
/// </summary> | |
public class RequestTimingFilter : IActionFilter, IResultFilter | |
{ |
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
############################################################################################ | |
#This script is created to remove Sitecore 9 instance from local machine. | |
#This will not uninstall Solr but, it will remove Solr collections. | |
#The script looks at the Prefix parameter and find out all instances and remove them. | |
#Change the default values before using the script. Or, pass the values as parameters. | |
#Usage: .\Remove-Sitecore9-Instance.ps1 -Prefix "xp0" | |
#Declaimer: This is a destructive script, means, it deletes files, databases etc. | |
#Use it at your own risk. |
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
# Add the Sitecore MyGet repository to PowerShell | |
#Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2 | |
# Install the Sitecore Install Framwork module | |
#Install-Module SitecoreInstallFramework | |
# Install the Sitecore Fundamentals module (provides additional functionality for local installations like creating self-signed certificates) | |
#Install-Module SitecoreFundamentals | |
# Import the modules into your current PowerShell context (if necessary) |
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
Param( | |
$solrVersion = "6.6.2", | |
$installFolder = "c:\solr", | |
$solrPort = "8983", | |
$solrHost = "solr", | |
$solrSSL = $true, | |
$nssmVersion = "2.24", | |
$JREVersion = "1.8.0_151" | |
) |
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
# Install Chocolatey if it's not already installed | |
if (-Not (Get-Command -Name choco -ErrorAction SilentlyContinue)) { | |
Set-ExecutionPolicy RemoteSigned | |
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
refreshenv | |
} | |
# Core (All Machines) | |
choco install 7zip.install -y | |
choco install googlechrome -y |
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
# | |
# MongoDB (as a windows service) | |
# | |
$mongoDbPath = "$env:SystemDrive\MongoDB" | |
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg" | |
$url = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-3.2.7.zip" | |
$zipFile = "$mongoDbPath\mongo.zip" | |
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-3.2.7" | |
if ((Test-Path -path $mongoDbPath) -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
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
using System.Text.RegularExpressions; | |
using System.Web.Mvc; | |
using Microsoft.Extensions.DependencyInjection; |
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
# | |
# Powershell script for adding/removing/showing entries to the hosts file. | |
# | |
# Known limitations: | |
# - does not handle entries with comments afterwards ("<ip> <host> # comment") | |
# | |
$file = "C:\Windows\System32\drivers\etc\hosts" | |
function add-host([string]$filename, [string]$ip, [string]$hostname) { |
NewerOlder