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
$AutoUpdateNotificationLevels = @{0 = "Not configured"; 1 = "Disabled" ; 2 = "Notify before download"; | |
3 = "Notify before installation"; 4 = "Scheduled installation" | |
} | |
$AutoUpdateDays = @{0 = "Every Day"; 1 = "Every Sunday"; 2 = "Every Monday"; 3 = "Every Tuesday"; 4 = "Every Wednesday"; | |
5 = "Every Thursday"; 6 = "Every Friday"; 7 = "EverySaturday" | |
} | |
Function Set-WindowsUpdateConfig { |
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
@using Umbraco.Web.Templates; | |
@using System.Text.RegularExpressions; | |
@using HtmlAgilityPack; | |
@model dynamic | |
<div class="cmscontent"> | |
@Html.Raw(TemplateUtilities.ParseInternalLinks(ParseMacros(Model.value.ToString()))) | |
</div> | |
@functions{ |
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
variables: | |
version.counter: $[counter(format('{0}_{1}', variables['Build.DefinitionName'], variables['Build.SourceBranchName']), 1)] | |
version.suffix: $[format('alpha-{0}{1}', variables['Build.SourceBranchName'], variables['version.counter'])] # Unknown branches are WIP | |
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') }}: | |
version.suffix: $[format('rc-{0}{1}', variables['Build.SourceBranchName'], variables['version.counter'])] # Ready for release | |
${{ if eq(variables['Build.SourceBranchName'], 'main') }}: | |
version.suffix: '' # No suffix for releases |
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
using System; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
public static class UrlHelperExtensions | |
{ | |
/// <summary> | |
/// Modified QueryString with key to value | |
/// </summary> |
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
<%@ Import Namespace="System.IO" %> | |
<%@ Import Namespace="System.Configuration" %> | |
<%@ Import Namespace="System.Net.Mail" %> | |
<%@ Import Namespace="System.Net.Sockets" %> | |
<%@ Import Namespace="System.Net.Security" %> | |
<%@ Import Namespace="System.Net.Configuration" %> | |
<%@ Import Namespace="Umbraco.Core.Configuration" %> | |
<%@ Page Language="C#" %> |
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
function ConvertFrom-UnixTime { | |
[CmdletBinding(DefaultParameterSetName = "Seconds")] | |
param ( | |
[Parameter(Position = 0, | |
ValueFromPipeline = $true, | |
Mandatory = $true, | |
ParameterSetName = "Seconds")] | |
[int] | |
$Seconds, |
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
Reference: http://demon.tw/my-work/vbs-json.html | |
VbsJson class for parsing JSON format data with VBS | |
Tags: JavaScript , JSON , VB , VBS , VBScript | |
Title: The VBS resolve VbsJson class of JSON data format of: Demon | |
Link: http://demon.tw/my-work/vbs-json.html | |
Copyright: All articles in this blog are subject to the terms of " Signature - Non-Commercial Use - Share 2.5 China in the Same Way ". |
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
# This causes Windows to wait the specified number of seconds before sending CTRL_SHUTDOWN_EVENT to the process. | |
# #RUN reg add hklm\system\currentcontrolset\services\cexecsvc /v ProcessShutdownTimeoutSeconds /t REG_DWORD /d 7200 | |
# This causes Windows to wait the specified number of milliseconds before killing a process after issuing a CTRL_SHUTDOWN_EVENT - essentially the rough equivalent of docker stop -t. | |
RUN reg add hklm\system\currentcontrolset\control /v WaitToKillServiceTimeout /t REG_SZ /d 7200000 /f |
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
function ConvertFrom-Ini ($filePath) | |
{ | |
$ini = @{} | |
$section = $ini | |
switch -regex -file $FilePath | |
{ | |
“^\[(.+)\]” # Section | |
{ | |
$section = $matches[1] | |
$ini.Add($section,@{}) |
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 XmlConvert | |
{ | |
public static string SerializeObject<T>(T dataObject, Formatting formatting = Formatting.None) | |
{ | |
if (dataObject == null) | |
{ | |
return string.Empty; | |
} | |
try | |
{ |
NewerOlder