Skip to content

Instantly share code, notes, and snippets.

View LockTar's full-sized avatar

Ralph Jansen LockTar

View GitHub Profile
@LockTar
LockTar / Copy-BranchPolicies.ps1
Last active January 25, 2024 13:59
Copy all Azure DevOps branch policies from one branch to another using Azure CLI
# Description: Copies branch policies from one branch to another branch
# Run the script in the root of the git repository
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string] $RepositoryName,
[Parameter(Mandatory = $true)]
[string] $FromBranch,
@LockTar
LockTar / Get-UserGroups.ps1
Created July 14, 2021 11:30
Azure DevOps UserGroups per user
Param
(
[PSCustomObject]$User,
[string]$Organization # https://dev.azure.com/foo
)
Write-Host "Get user groups for user: $($User.principalName) in organisation $Organization"
$UserGroups = @()
@LockTar
LockTar / Wifi-in-de-trein.ps1
Created May 2, 2018 20:37
Sets metered connection on in Windows 10 for wifi in the train (NS Holland). In that way wifi is faster because background tasks are paused.
$wifiProfile = "WiFi in de trein";
#$wifiProfile = "Guest Hotspot";
# Get list of saved Wifi connections
#netsh wlan show profiles
# Show details of Wifi connection
$output = netsh wlan show profiles name=$wifiProfile key=clean
$costs = $output | Select-String -Pattern 'Cost'
@LockTar
LockTar / CreateCARoot.cmd
Last active January 9, 2017 07:37
Create self signed certificates with makecert. Run the command in the Visual Studio Developer command prompt for direct access of makecert. Call the CreateCARoot.cmd first without any parameters. This will create a CARoot certificate. Call CreateSslServerCert.cmd with the name of the certificate als parameter. Like this CreateSslServerCert.cmd S…
makecert.exe ^
-n "CN=CARoot" ^
-r ^
-pe ^
-a sha512 ^
-len 4096 ^
-cy authority ^
-sv CARoot.pvk ^
CARoot.cer
@LockTar
LockTar / JsonPropertyValidationRule.cs
Created September 11, 2015 15:11
A JSON validation rule for Visual Studio webtest that validates a property of a JSON response
using Microsoft.VisualStudio.TestTools.WebTesting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.ComponentModel;
namespace Extensions.ValidationRules
{
/// <summary>
/// A JSON validation rule for Visual Studio webtest that validates a property of a JSON response.
/// </summary>
@LockTar
LockTar / JsonPropertyExtractionRule.cs
Created September 11, 2015 15:09
A JSON extraction rule for Visual Studio webtest that extracts a value from a JSON response
using Microsoft.VisualStudio.TestTools.WebTesting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.ComponentModel;
namespace Extensions.ExtractionRules
{
/// <summary>
/// A JSON extraction rule for Visual Studio webtest that extracts a value from a JSON response.
/// </summary>