Skip to content

Instantly share code, notes, and snippets.

View Set-DxAddon.ps1
# Usage examples
# .\Set-DxAddon.ps1 -Url "http://server:83" -Path
# .\Set-DxAddon.ps1 -Path
param (
[parameter(Mandatory=$false, HelpMessage="Tridion DX Add-on service URL. Defaults to 'http://localhost:83'")]
[string] $Url = "http://localhost:83",
[parameter(Mandatory=$true, HelpMessage="Path to to the add-on.")]
[string] $Path
jhorsman / gist:63676578b1376359a4337aa31417fbfe
Last active May 17, 2019 — forked from jpoehls/gist:2030795
Using CTRL+W to close tabs in Visual Studio
View gist:63676578b1376359a4337aa31417fbfe

For Visual Studio 2017 (and other versions) with ReSharper

In Tools | Options | Environmen | Keyboard...

  1. Add CTRL+W as a Global shortcut for Window.CloseDocumentWindow
  2. Remove the CTRL+W shortcut for Edit.SelectCurrentWord
  3. Remove the CTRL+W shortcut from ReSharper.ReSharper_ExtendSelection (it might be assigned twice)

If CTRL+W does not work after the steps above, it might be assigned to something else. Check these instructions to troubleshoot that:

View DXA 2.1 core article.xslt
<!-- this XSLT is from the article schema in the core module from DXA 2.1 -->
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></xsl:output>
<xsl:template match="/ | node() | @*">
<xsl:apply-templates select="node() | @*"></xsl:apply-templates>
<xsl:template match="*[ (self::br or self::p or self::div) and normalize-space(translate(., &apos; &apos;, &apos;&apos;)) = &apos;&apos; and not(@*) and not(processing-instruction()) and not(comment()) and not(*[not(self::br) or @* or * or node()]) and not(following::node()[not( (self::text() or self::br or self::p or self::div) and normalize-space(translate(., &apos; &apos;, &apos;&apos;)) = &apos;&apos; and not(@*) and not(processing-instruction()) and not(comment()) and
View git-clean
# see
git clean -dxf
# -d Remove untracked directories in addition to untracked files.
# -x Don’t use the standard ignore rules read from .gitignore...
# -f force, Git will not remove files unless -f is set
jhorsman / gist:82e2acde0f747fbcd21f6757943b09c7
Created Jan 29, 2019
Open Microsoft SQL Server Management Studio from the command line
View gist:82e2acde0f747fbcd21f6757943b09c7
# use this in case the management studio is not available in the Windows Start menu
jhorsman / purge-publishing-queue
Created Jan 4, 2019
Purge old Tridion Sites publishing transactions
View purge-publishing-queue
Remove-TcmPublishTransactions -Succesful -Before (Get-Date).AddDays(-14)
jhorsman / Restart-Docs.ps1
Created Dec 18, 2018
Script to restart SDL Tridion Docs content manager services. This covers the Windows services, component service and IIS application pools. Something similar can be done with the ISHDeploy module from
View Restart-Docs.ps1
Restarts Docs Content Manager services
Restart-Docs -WindowsServices
Restart-Docs -ComponentServices
Restart-Docs -ApplicationPools
Restart-Docs -ComponentServices -ApplicationPools
jhorsman / Test-ServerSSLSupport
Created Nov 7, 2018
Check which SSL/TLS versions are supported by a given hostname
View Test-ServerSSLSupport
function Test-ServerSSLSupport {
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[UInt16]$Port = 443
process {
$RetValue = New-Object psobject -Property @{
jhorsman / Web.config
Created Oct 17, 2018
UDP service configuration in Web.config
View Web.config
<add key="discovery-service-uri" value="http://hostname:8082/discovery.svc" />
<add key="model-service-uri" value="http://hostname:8998" />
<add key="oauth-enabled" value="true" />
<add key="oauth-client-id" value="username" />
<add key="oauth-client-secret" value="password" />
jhorsman / Encrypt-Config.ps1
Created Oct 3, 2018
Encrypt-Config.ps1: A PowerShell tool to encrypt or decrypt .NET app.config files
View Encrypt-Config.ps1
[parameter(Mandatory=$false, HelpMessage="Encrypt the secure app settings")]
[parameter(Mandatory=$false, HelpMessage="Decrypt the secure app settings")]
$ErrorActionPreference = "Stop"