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
# Usage: | |
# This script is designed to be run after you have Solr running locally without SSL | |
# It will generate a trusted, self-signed certificate for LOCAL DEV (this must be modified for production) | |
# Notes: The keystore must be under server/etc on Solr root, and MUST be named solr-ssl.keystore.jks | |
# The cert will be added to locally trusted certs, so no security warnings in browsers | |
# You must still reconfigure Solr to use the keystore and restart it after running this script | |
# | |
# THIS SCRIPT REQUIRES WINDOWS 10 (for the SSL trust); without 10 remove the lines around trusting the cert. | |
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
# specify your path here. It is most likely be page templates and page content | |
$startPath = "/sitecore/content" | |
Get-ChildItem -Path $startPath -Recurse | ForEach-Object { | |
$item = $_; | |
Get-Rendering -Item $_ -FinalLayout | ForEach-Object { | |
$rendering = $_; | |
$matches = [regex]::Matches($_.Placeholder,'(?<guid>_[\d\w]{8}\-(?:[\d\w]{4}\-){3}[\d\w]{12})(?<seed>_?\d?)') | |
if ($matches.Success) { | |
Write-Host "Match found in item - [$($item.Paths.FullPath)]" | |
Write-Host "Old Placeholder - [$($rendering.Placeholder)]" |
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
<# | |
Set-ExecutionPolicy RemoteSigned | |
#> | |
Import-Module -Name SPE | |
$session = New-ScriptSession -Username remoteadmin -Password test -ConnectionUri https://sitecoreinstance.local | |
$jobId = Invoke-RemoteScript -ScriptBlock { | |
Write-Verbose ("Started at " + [System.DateTime]::Now) | |
$files = Get-ChildItem $SitecoreLogFolder |
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
# First we create the request. | |
$HTTP_Request = [System.Net.WebRequest]::Create('https://google.com') | |
$HTTP_Request.Timeout = 60000 | |
# We then get a response from the site. | |
$HTTP_Response = $HTTP_Request.GetResponse() | |
# We then get the HTTP code as an integer. | |
$HTTP_Status = [int]$HTTP_Response.StatusCode | |
If ($HTTP_Status -eq 200) { |
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
#Requires -RunAsAdministrator | |
#Author: Sergejs Kravcenko | |
#Date: 12/07/2018 | |
#Description: RenewCertificate module, which allows to safely generate and issue new Sitecore Self-Signed certificates both Root and Personal in order to have Sitecore instance function correctly with its xConnect services | |
#Usage: Import-Module .\RenewCertificate.psm1 | |
Write-Host "Importing RenewCertificateModule" | |
function New-RootCertificateFn{ | |
param ( |
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
$inputProps = @{ | |
Prompt = "Enter the targeted item ID (Guid):" | |
Validation = [Sitecore.Configuration.Settings]::ItemNameValidation | |
ErrorMessage = "'`$Input' is not a valid item ID." | |
} | |
$itemId = Show-Input @inputProps | |
[Sitecore.Context]::SetActiveSite("website") | |
$urlop = [Sitecore.Links.LinkManager]::GetDefaultUrlOptions() |
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( | |
[string]$userName, | |
[string]$permission, | |
[string]$certStoreLocation, | |
[string]$certThumbprint | |
); | |
# check if certificate is already installed | |
$certificateInstalled = Get-ChildItem cert:$certStoreLocation | Where thumbprint -eq $certThumbprint | |
# download & install only if certificate is not already installed on machine |
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 | |
( | |
[ValidateScript( {Test-Path $_})] | |
[string]$path, | |
[switch] $force = $false | |
) | |
if (Test-Path $path) { | |
if ($path -like "*C:*" -and -not $force) { | |
Write-Error "$path is system path cannot be used" | |
} |
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
# Load IIS module: | |
Import-Module WebAdministration | |
# Get AppPool Name | |
$appPoolName = $OctopusParameters['appPoolName'] | |
# Get the number of retries | |
$retries = $OctopusParameters['appPoolCheckRetries'] | |
# Get the number of attempts | |
$delay = $OctopusParameters['appPoolCheckDelay'] |
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
# Load IIS module: | |
Import-Module WebAdministration | |
# Get AppPool Name | |
$appPoolName = $OctopusParameters['appPoolName'] | |
Write-Output "Starting IIS app pool $appPoolName" | |
Start-WebAppPool $appPoolName | |
OlderNewer