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
| function FixupXConnect | |
| { | |
| $source = "xconnect-xp0.json" | |
| $json = Get-Content $source -Raw | ConvertFrom-Json | |
| $json.Tasks.AddSqlDatabasesToElasticPool.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true) | |
| $json.Tasks.CreateShardApplicationDatabaseServerLoginInvokeSqlCmd.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true) | |
| $json.Tasks.CreateShardManagerApplicationDatabaseUserInvokeSqlCmd.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($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
| using System.Net.Http; | |
| using System.Threading.Tasks; | |
| using System.Net.Http.Json; | |
| using System.Text.Json.Nodes; | |
| using System.Net.Http.Headers; | |
| using System.Text.Json; | |
| using System.Text.Json.Serialization; | |
| internal class Program | |
| { |
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
| using Statiq.App; | |
| using Statiq.Common; | |
| using StatiqGenerator.Customisations.ReadingTime; | |
| namespace StatiqGenerator.Customisations.DisappearingLinks | |
| { | |
| public class ExpiringLinkConfigurator : IConfigurator<Bootstrapper> | |
| { | |
| public void Configure(Bootstrapper configurable) |
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
| #Requires -RunAsAdministrator | |
| param( | |
| [string]$dockerEnginePath = "C:\", | |
| [string]$dockerInstallPath = "C:\Docker", | |
| [string]$dockerEngineUrl = "https://download.docker.com/win/static/stable/x86_64/docker-20.10.8.zip", | |
| [string]$dockerZip = "docker.zip", | |
| [string]$serviceName = "docker", | |
| [string]$composeEngineUrl = "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Windows-x86_64.exe", |
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
| async Task Main() | |
| { | |
| var pipeline = new ExampleAsyncPipeline(); | |
| var uri = new Uri("https://news.bbc.co.uk/"); | |
| var tempFile = await pipeline.ProcessAsync(uri); | |
| Console.WriteLine($"{uri} saved to {tempFile}"); | |
| } |
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
| async Task Main() | |
| { | |
| var pipeline = new ExampleAsyncPipeline(); | |
| var uri = new Uri("https://news.bbc.co.uk/"); | |
| var tempFile = await pipeline.ProcessAsync(uri); | |
| Console.WriteLine($"{uri} saved to {tempFile}"); | |
| } |
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
| function Write-EmbeddedFile | |
| { | |
| param | |
| ( | |
| [string]$base64, | |
| [string]$targetFile | |
| ) | |
| process | |
| { | |
| $Content = [System.Convert]::FromBase64String($base64) |
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
| [cmdletbinding(SupportsShouldProcess=$True)] | |
| param( | |
| # What .tar.gz file should be extracted? Must exist. | |
| [Parameter(Mandatory=$True)] | |
| [string]$FileToExtract, | |
| # What folder should the files be extracted into? Does not need to exist | |
| [Parameter(Mandatory=$True)] | |
| [string]$TargetFolder, |
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
| ## | |
| ## private functions | |
| ## | |
| # | |
| # If necessary, download a file and unzip it to the specified location | |
| # | |
| function downloadAndUnzipIfRequired | |
| { | |
| Param( |
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
| public struct Either<SUCCESS, FAILURE> | |
| { | |
| private readonly bool _isSuccess; | |
| private readonly SUCCESS _success; | |
| private readonly FAILURE _failure; | |
| public bool IsSuccess => _isSuccess; | |
| public bool IsFailure => !IsSuccess; | |
| public SUCCESS SuccessValue => _success; |
NewerOlder