Skip to content

Instantly share code, notes, and snippets.

@jhorsman
jhorsman / appsettings.json
Last active August 5, 2023 19:37
Proxy configuration in .NET Core appsettings.json. See https://gist.github.com/jhorsman/d995ded7e6f9ad2e2260cd4549aeaf26 for .NET Framework
{
"defaultProxy": {
"proxy": {
"-usesystemdefault": "True",
"-proxyaddress": "http://localhost:8500",
"-bypassonlocal": "False"
}
}
}
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
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.
# Inspired by https://gist.github.com/jbratu/6262684939e15e638892973f5f8eed78 and https://stackoverflow.com/questions/55914397/enable-tls-and-disable-ssl-via-powershell-script
function Disable-SSL-2.0 {
New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -Force | Out-Null
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -name Enabled -value 0 -PropertyType 'DWord' -Force | Out-Null
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -name 'DisabledByDefault' -value 1 -PropertyType 'DWord' -Force | Out-Null
New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client' -Force | Out-Null
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client' -name Enabled -value 0 -PropertyType 'DWord' -Force | Out-Null
New-Ite
function Test-ServerSSLSupport {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[ValidateNotNullOrEmpty()]
[string]$HostName,
[UInt16]$Port = 443
)
process {
$RetValue = New-Object psobject -Property @{
# 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
# 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)
}