Skip to content

Instantly share code, notes, and snippets.

View SoulOfUniverse's full-sized avatar
🤖

Sergejs Kravcenko SoulOfUniverse

🤖
View GitHub Profile
@SoulOfUniverse
SoulOfUniverse / PingingWebsite.ps1
Created July 13, 2021 19:01
Pinging any target url
# 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) {
@SoulOfUniverse
SoulOfUniverse / RunPseRemotely.ps1
Created July 13, 2021 19:00
Visual Studio Remote Sitecore Powershell Extension
<#
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
@SoulOfUniverse
SoulOfUniverse / SitecoreMigrateRenderings8to10.ps1
Created July 13, 2021 18:57
Convert renderings from Sitecore 8 to 9+ version
# 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)]"
@SoulOfUniverse
SoulOfUniverse / anexample.ps1
Created January 11, 2018 12:56 — forked from kamsar/anexample.ps1
Generate trusted local SSL cert for Solr
# 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.