Skip to content

Instantly share code, notes, and snippets.

@rsenk
rsenk / cleanHabitat.ps1
Created March 27, 2019 09:54
Remove obj and bin in Sitecore Habitat solution
get-childitem -r bin | Where-Object { $_.Parent.Name -eq 'code' } | Remove-Item -force -r
get-childitem -r obj | Where-Object { $_.Parent.Name -eq 'code' } | Remove-Item -force -r
@rsenk
rsenk / be-sitecore-ready.ps1
Last active July 25, 2018 20:10
Create a VM Sitecore ready
function Disable-ieESC {
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0
Stop-Process -Name Explorer
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green
}
function Install-FromWeb {
dir | % { """9u1\\$_""," }
@rsenk
rsenk / update-license.ps1
Created February 15, 2018 15:29
Bulk update Sitecore licenses
#requires -RunAsAdministrator
# Update all licenses
# You can find more about automation with Powershell on http://lets-share.senktas.net
$iisRoot = "C:\inetpub\wwwroot"
$licenseFile = "C:\license.xml"
(Get-ChildItem -Path $iisRoot -Filter 'license.xml' -Recurse).DirectoryName | % { Copy-Item -Path $licenseFile -Destination $_ -Verbose}