This file contains 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
<# | |
.SYNOPSIS | |
Adds an XML fragment to an XmlNode | |
.DESCRIPTION | |
Adds an XML fragment to an XmlNode | |
.NOTES | |
Author : Thomas Freudenberg - info@thomasfreudenberg.com | |
This file contains 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 static class AnsiConsoleExtensions | |
{ | |
public static IAnsiConsole WriteJson(this IAnsiConsole console, JsonElement node, JsonStyle? jsonStyle = null) | |
{ | |
ArgumentNullException.ThrowIfNull(console); | |
ArgumentNullException.ThrowIfNull(node); | |
console.WriteJson(node, jsonStyle ?? JsonStyle.Default, 0); | |
return console; | |
} |
This file contains 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 class EncryptingJsonConverter : JsonConverter { | |
private readonly byte[] _encryptionKeyBytes; | |
public EncryptingJsonConverter(string encryptionKey) { | |
if (encryptionKey == null) { | |
throw new ArgumentNullException(nameof(encryptionKey)); | |
} | |
// Hash the key to ensure it is exactly 256 bits long, as required by AES-256 | |
using (var sha = new SHA256Managed()) { |
This file contains 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( | |
[int]$CutoffDays = 150 | |
) | |
$cutoffDate = (Get-Date).AddDays(-$CutoffDays) | |
# get path to cached NuGet packages ("%USERPROFILE$\.nuget\packages") | |
$nugetCachePath = Join-Path "$([System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile))" ".nuget\packages" |
OlderNewer