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 | |
Creates common headers for Azure Devops API | |
.DESCRIPTION | |
Creates common headers for Azure Devops API with prepared Authorization token and Content-Type application/json. | |
Must be executed from Azure Devops Pipeline to have the $env:SYSTEM_ACCESSTOKEN variable available. | |
.INPUTS | |
None. You cannot pipe objects to Get-CommonHeaders. |
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
{ | |
"info": { | |
"_postman_id": "bad5bcb8-d07d-498a-92c7-6f85c7429d4d", | |
"name": "Azure Devops", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "AddComment", | |
"request": { |
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 Send-GridEmail(){ | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$From, | |
[Parameter(Mandatory=$true)] | |
[object[]]$To, | |
[Parameter(Mandatory=$true)] | |
[string]$Subject, | |
[Parameter(Mandatory=$true)] | |
[string]$Body, |
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 Send-GridEmail(){ | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$From, | |
[Parameter(Mandatory=$true)] | |
[string[]]$To, | |
[Parameter(Mandatory=$true)] | |
[string]$Subject, | |
[Parameter(Mandatory=$true)] | |
[string]$Body, |
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
private decimal[] DivideEqualy(decimal[] array, decimal amount) | |
{ | |
if (array.Length == 1) | |
{ | |
return new decimal[] { amount }; | |
} | |
decimal sum = array.Sum(); | |
var precalculated = array.Select(l => amount * l / sum); | |
var ints = new LinkedList<int>(precalculated.Select(l => (int)l).OrderByDescending(x => x)); |
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
# config.json | |
#{ | |
# "variables": [ | |
# { | |
# "name": "basePath", | |
# "value": "C:\\inetpub\\approot" | |
# } | |
# ], | |
# "test": "$basePath\\test" | |
#} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<meta http-equiv="refresh" content="10"/> | |
<title>Site Maintenance</title> | |
<style> |
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
param( | |
[Parameter(Mandatory = $true)] | |
[string]$Source, | |
[Parameter(Mandatory = $true)] | |
[string]$Destination | |
) | |
$global:appOfflineGistUrl = 'https://gist.githubusercontent.com/TomasBouda/176632ebcccaf684ea09231935f4d300/raw/ff6662b3131ed43fe206403b62ec2129fae81a83/App_offline.htm' | |
function Copy-WithProgress { |
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 StringEncryption | |
{ | |
private static readonly byte[] Entropy = Encoding.Unicode.GetBytes("4asd894a9d8as5d4sad4asd48sa9w8d4aw8da1d"); | |
public static string EncryptString(this SecureString input) | |
{ | |
var encryptedData = ProtectedData.Protect( | |
Encoding.Unicode.GetBytes(ToInsecureString(input)), | |
Entropy, | |
DataProtectionScope.CurrentUser); |
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
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", | |
"alwaysShowTabs": true, | |
"showTabsInTitlebar": true, |
OlderNewer