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
$ErrorActionPreference = "Stop" | |
Set-StrictMode -Version Latest | |
# config.json example contents: | |
# { | |
# "Audience": "<some service audience>", | |
# "Serviceurl": "<some service url>", | |
# "Idp": "idp.dlbr.dk", | |
# "Serviceaccountusername": "<some service account username>", | |
# "Serviceaccountpassword": "<some service account password>" |
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
$git = "git.exe" # or change to absolute path if not in PATH | |
$gitRepos = Get-ChildItem -Recurse -Directory | Where-Object { Get-ChildItem $_.FullName -Directory -Hidden -Filter ".git" } | |
foreach ($gitRepo in $gitRepos) | |
{ | |
Write-Host "Pulling $($gitRepo.Fullname)" | |
pushd | |
cd $gitRepo.Fullname | |
&$git pull | |
popd | |
} |
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
Set-StrictMode -Version Latest | |
$ErrorActionPreference = "Stop" | |
$VerbosePreference = "Continue" | |
# https://social.technet.microsoft.com/Forums/ie/en-US/8553bfcb-6170-4c25-8cb7-0f83e3bb0370/periodic-hangs-when-using-the-builtin-adfs-powershell-cmdlets-in-adfs-v2016?forum=ADFS | |
$iterations = 50 | |
$sw = [system.diagnostics.stopwatch]::startNew() | |
$rpNames = 1..50|ForEach-Object { "HangReproRP$_" } | |
Write-Verbose "Ensuring repro RPs are created..." |
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
import sublime, sublime_plugin, random, string, os | |
class saveunnamedbuffersCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
print("Init") | |
for window in sublime.windows() : | |
for view in window.views() : | |
dirty = view.is_dirty() | |
filename = str(view.file_name()) | |
print(str(dirty) + " " + filename) |
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; | |
using System.Configuration; | |
using System.IdentityModel.Tokens; | |
using System.Net.Http; | |
using System.Security.Claims; | |
using System.Threading.Tasks; | |
using Dlbr.CommonLogin.Owin; | |
using Microsoft.IdentityModel.Extensions; | |
using Microsoft.IdentityModel.Protocols; | |
using Microsoft.Owin.Logging; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<PortableRelyingParty xmlns="http://schemas.datacontract.org/2004/07/Dlbr.CommonLogin.AdfsSnapIn" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> | |
<AutoUpdateEnabled>false</AutoUpdateEnabled> | |
<ClaimsAccepted /> | |
<ConflictWithPublishedPolicy>false</ConflictWithPublishedPolicy> | |
<DelegationAuthorizationRules /> | |
<Enabled>true</Enabled> | |
<EncryptClaims>true</EncryptClaims> | |
<EncryptedNameIdRequired>false</EncryptedNameIdRequired> | |
<EncryptionCertificateRevocationCheck>CheckChainExcludeRoot</EncryptionCertificateRevocationCheck> |
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
Import-Module Azure | |
Set-StrictMode -version 4 | |
$location = "North Europe" | |
$resourceGroupName = 'Default-Web-' + $location.Replace(' ', ''); | |
$webHostingPlanName = "StandardSmall"; | |
$websiteResourceType = "Microsoft.Web/sites"; | |
$stagingSlotResourceType = "Microsoft.Web/sites/slots"; | |
function New-AzureWebHostingPlan($hostingPlanName) | |
{ |
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
# wget tinyurl.com/enablerdp -outfile .\rdp.ps1 | |
# .\rdp.ps1 | |
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0 | |
Enable-NetFirewallRule -DisplayGroup "Remote Desktop" | |
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1 |
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
# Invoke using following syntax: | |
# http://boxstarter.org/package/url?[input url to this gists] | |
# Boxstarter options | |
$Boxstarter.RebootOk=$true # Allow reboots? | |
$Boxstarter.NoPassword=$false # Is this a machine with no login password? | |
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot | |
# Basic setup | |
Update-ExecutionPolicy Unrestricted |
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()] | |
Param( | |
[Parameter(Mandatory=$True,Position=1)] | |
[string]$csprojInFile, | |
[Parameter(Mandatory=$True,Position=2)] | |
[string]$csprojOutFile | |
) | |
$csproj = [xml](get-content $csprojInFile) | |
$xmlns = $csproj.Project.xmlns |