Skip to content

Instantly share code, notes, and snippets.

function SetOrAdd-ItemProperty ($key, $name, $value) {
if (!(Test-Path $key)) {
New-Item $key > $null
}
Set-ItemProperty $key $name $value
}
function Disable-ShutdownEventTracker {
# source: http://technet.microsoft.com/en-us/library/cc776766(v=ws.10).aspx
@jhorsman
jhorsman / SDL Tridion versions
Last active May 29, 2020 08:47
SDL Tridion versions and release dates
Release 1 (1996)
Release 2 (1997)
Release 3 (1999)
Release 4 (2001)
Release 5 (2003)
Tridion 5.1 (2005)
Tridion 5.2 (2006)
SDL Tridion 5.3 (January 2008)
SDL Tridion 2009 (November 2009)
SDL Tridion 2011 (Januari 2011)
Write-Output "test" > " another test in space.txt"
Get-Item "*.txt"
<appender name="rollingSI4TExtensionsLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.folder}/si4t-extentions.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>${log.history}</maxHistory>
</rollingPolicy>
<encoder>
<charset>${log.encoding}</charset>
<pattern>${log.pattern}</pattern>
</encoder>
<prudent>true</prudent>
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
@jhorsman
jhorsman / clean-git-repo.sh
Last active October 8, 2019 20:30
Clean a git repo, remove untracked files etc.
git clean -fdXi
git clean -fdxi
From https://stackoverflow.com/a/32510141/1678525
jdk.tls.disabledAlgorithms= SSLv2Hello, SSLv3, TLSv1, TLSv1.1
In the file jre/lib/security/java.security on the server
Mind that the jdk.tls.disabledAlgorithms might already have many more protocols, add the protocols above to that list.
function Test-ServerSSLSupport {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[ValidateNotNullOrEmpty()]
[string]$HostName,
[UInt16]$Port = 443
)
process {
$RetValue = New-Object psobject -Property @{
@jhorsman
jhorsman / DecomissionPublishingTarget.ps1
Last active September 12, 2019 13:35
Decomission an SDL Tridion 2013 SP1 Publishing Target with PowerShell and Core Service. See http://tridion.stackexchange.com/questions/12701/how-to-decomission-a-publishing-target-with-powershell
# Make sure Tridion-PowerShell-Modules is installed fist https://github.com/pkjaer/tridion-powershell-modules
Import-Module Tridion-CoreService
Set-TridionCoreServiceSettings -Version 2013-SP1
$client = Get-TridionCoreServiceClient
# Listing the publication targets does not work for Sites 9 and up
#$filter = New-Object Tridion.ContentManager.CoreService.Client.PublicationTargetsFilterData;
#$client.GetSystemWideList($filter)
# see https://github.com/pkjaer/tridion-powershell-modules
# see https://gist.github.com/jhorsman/b218ba7e2e5587d21c395d5968583b61 to learn more about configuring the Tridion-CoreService module
# Install the Tridion-CoreService module from the Tridion-Powershell-Modules project
Install-Module -Name Tridion-CoreService
Import-Module -Name Tridion-CoreService
# Set the server configuration
Set-TridionCoreServiceSettings -Credential (Get-Credential) -CredentialType Windows
Set-TridionCoreServiceSettings -HostName my-cms-server -Version Web-8.5 -ConnectionType Basic-SSL