This file contains hidden or 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 admin -Password b -ConnectionUri https://platform | |
Invoke-RemoteScript -ScriptBlock { | |
Get-Item -Path "master:\content\Home" | |
} -Session $session |
This file contains hidden or 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
-- you should have you DB up& running (for example, after restoring) | |
-- then you need to detach the database and delete that huge .LDF file | |
-- it will get re-created upon re-attaching by using the below command | |
CREATE DATABASE databasename | |
ON (FILENAME= 'c:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\databasename_web.mdf') | |
FOR ATTACH_REBUILD_LOG | |
GO |
This file contains hidden or 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
gci -r -include "*.yml","*.xml" | foreach-object { $a = $_.fullname; ( get-content $a -Encoding UTF8) | foreach-object { $_ -replace "FROM VALUE","TO VALUE" } | set-content $a -Encoding UTF8} |
This file contains hidden or 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 for this scrtip: | |
# .\ConvertTo-PublishingServiceWdp.ps1 -Path "C:\Sitecore Publishing Service 3.1.1 rev. 180807-x64.zip" -Destination "C:\output" | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory = $true)] | |
[ValidateScript({ (Test-Path $_ -PathType Leaf) -and ($_ -match '\.zip$') })] | |
[string]$Path, | |
[Parameter(Mandatory=$true)] |
This file contains hidden or 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: | |
# .\ConvertTo-PublishingModuleWdp.ps1 -SitecoreAzureToolkitRoot "C:\Sitecore\SAT" -Path "C:\Sitecore Publishing Module 3.1.4 rev. 200110.zip" -Destination "C:\output" | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
[ValidateScript({ Test-Path $_ -PathType Container -IsValid })] | |
[string]$SitecoreAzureToolkitRoot, | |
[Parameter(Mandatory = $true)] |
This file contains hidden or 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
"modules": { | |
"value": { | |
"items": [ | |
{ | |
"name": "ps", | |
"templateLink": "https://yourdomain.com/ps-arm/<version>/azuredeploy.json", | |
"parameters": { | |
"templateLinkAccessToken": "Optional access token for the template if stored in Azure storage. Otherwise should be empty string.", | |
"psMsDeployPackageUrl": "<URL of the WDP file Sitecore Publishing Service *-x64.wdp.zip>", | |
"psModuleMsDeployPackageUrl": "<URL of the WDP file Sitecore Publishing Module *.scwdp.zip>" |
This file contains hidden or 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
# You may want to clean up \bin and \obj folders | |
#Get-ChildItem .\ -include bin,obj -Recurse | ForEach-Object ($_) { Remove-Item $_.FullName -Force -Recurse } | |
gci -r -include "*.csproj" | foreach-object { $a = $_.fullname; ( Get-Content -Raw $a -Encoding UTF8) | foreach-object { $_ -replace '<Project ToolsVersion="12.0"','<Project ToolsVersion="15.0"' } | set-content -NoNewLine $a -Encoding UTF8} | |
gci -r -include "*.csproj" | foreach-object { $a = $_.fullname; ( Get-Content -Raw $a -Encoding UTF8) | foreach-object { $_ -replace '<TargetFrameworkVersion>v4\.\d\.\d</TargetFrameworkVersion>','<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>' } | set-content -NoNewLine $a -Encoding UTF8} | |
gci -r -include "web.config" | foreach-object { $a = $_.fullname; ( Get-Content -Raw $a -Encoding UTF8) | foreach-object { $_ -replace '<compilation debug="true" targetFramework="4.6.1"','<compilation debug="true" targetFramework="4.8"' } | set-content -NoNewLine $a -Encoding UTF8} |
This file contains hidden or 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
gci -r -include "*.csproj" | foreach-object { $a = $_.fullname; ( Get-Content -Raw $a -Encoding UTF8) | foreach-object { $_ -replace 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform.\d+.\d+.\d+\\build\\net\d{1,3}\\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props','Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\build\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets' } | set-content -NoNewLine $a -Encoding UTF8} | |
gci -r -include "*.csproj" | foreach-object { $a = $_.fullname; ( Get-Content -Raw $a -Encoding UTF8) | foreach-object { $_ -replace 'Microsoft.Net.Compilers.\d+.\d+.\d+','Microsoft.Net.Compilers.3.9.0' } | set-content -NoNewLine $a -Encoding UTF8} | |
gci -r -include "packages.config" | foreach-object { $a = $_.fullname; ( Get-Content -Raw $a -Encoding UTF8) | foreach-object { $_ -replace '<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="\d+.\d+.\d+" targetFramework="net\d{1,3}" ','<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatfo |
This file contains hidden or 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[]]$Address = $(1..20 | %{"192.168.1.$_"}), | |
[int]$Threads = 5 | |
) | |
write-host "Distributing addresses around jobs" | |
$JobAddresses = @{} | |
$CurJob = 0 | |
$CurAddress = 0 | |
while ($CurAddress -lt $Address.count) |
This file contains hidden or 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
New-Item ` | |
'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server' ` | |
-Force | Out-Null | |
New-ItemProperty ` | |
-path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server' ` | |
-name 'Enabled' -value '0' -PropertyType 'DWord' -Force | Out-Null | |
New-ItemProperty ` | |
-path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server' ` |