Skip to content

Instantly share code, notes, and snippets.

# Install the Tridion-CoreService module from the Tridion-Powershell-Modules project. See https://github.com/pkjaer/tridion-powershell-modules
Install-Module -Name Tridion-CoreService
Import-Module -Name Tridion-CoreService
# Set the server configuration
Set-TridionCoreServiceSettings -HostName my-cms-server -Version Web-8.5 -ConnectionType Basic
Set-TridionCoreServiceSettings -Credential (Get-Credential) -CredentialType Windows
# Alternatively use SSL (https)
#Set-TridionCoreServiceSettings -HostName my-cms-server -Version Web-8.5 -ConnectionType Basic-SSL
# from https://superuser.com/a/1479800/477803
function Test-DesktopIconHidden {
[CmdletBinding(SupportsShouldProcess=$false)]
Param()
Process {
$Shell = New-Object -ComObject "Shell.Application"
$Shell.GetSetting(0x4000)
}
# Usage examples
# .\Set-DxAddon.ps1 -Url "http://server:83" -Path addon.zip
# .\Set-DxAddon.ps1 -Path addon.zip
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
jhorsman / gist:63676578b1376359a4337aa31417fbfe
Last active May 17, 2019 06:47 — forked from jpoehls/gist:2030795
Using CTRL+W to close tabs in Visual Studio

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: https://gist.github.com/jpoehls/2030795#gistcomment-2335647

<!-- this XSLT is from the article schema in the core module from DXA 2.1 -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></xsl:output>
<xsl:template match="/ | node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"></xsl:apply-templates>
</xsl:copy>
</xsl:template>
<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
# see https://git-scm.com/docs/git-clean
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
jhorsman / fetch-all.ps1
Last active February 4, 2019 08:57
Fetch multiple GIT repos
$ErrorActionPreference = "Stop"
Function FetchRepo($directory)
{
git -C $directory fetch
if ($LASTEXITCODE -gt 0)
{
Throw "Something went wrong while fetching $directory"
}
Write-Host -ForegroundColor green "fetched $directory"
@jhorsman
jhorsman / gist:82e2acde0f747fbcd21f6757943b09c7
Created January 29, 2019 09:19
Open Microsoft SQL Server Management Studio from the command line
# use this in case the management studio is not available in the Windows Start menu
ssms.exe
@jhorsman
jhorsman / Restart-Docs.ps1
Created December 18, 2018 14:43
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 https://github.com/sdl/ISHDeploy.
<#
.SYNOPSIS
Restarts Docs Content Manager services
.EXAMPLE
Restart-Docs
Restart-Docs -WindowsServices
Restart-Docs -ComponentServices
Restart-Docs -ApplicationPools
Restart-Docs -ComponentServices -ApplicationPools
@jhorsman
jhorsman / Test-ServerSSLSupport
Created November 7, 2018 21:31
Check which SSL/TLS versions are supported by a given hostname
function Test-ServerSSLSupport {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[ValidateNotNullOrEmpty()]
[string]$HostName,
[UInt16]$Port = 443
)
process {
$RetValue = New-Object psobject -Property @{