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
private static X509Certificate2 GetIISExpressCertificateFromLocalStore() | |
{ | |
// http://stackoverflow.com/questions/1742938/how-to-solve-could-not-establish-trust-relationship-for-the-ssl-tls-secure-chan | |
ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => true; | |
var store = new X509Store(StoreLocation.CurrentUser); | |
store.Open(OpenFlags.ReadOnly); | |
var certs = store.Certificates.Find(X509FindType.FindBySubjectName, "localhost", false); |
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
<# | |
.SYNOPSIS | |
Using AppName the script will find all variables for that project. | |
It will then look at EnvironmentToCheck for variables that have | |
been configured in other environments but not the one specified | |
i.e. | |
A variable named "Test" under the scope of a "Test" environment | |
will be reported if a "Test" variable under the "Prod" environment |
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
/// <summary> | |
/// Helper class to find all validators and provide a common way of validating objects. | |
/// </summary> | |
public class ValidationEngine | |
{ | |
private static readonly Dictionary<Type, IValidator> AllValidatorsInAssembly; | |
static ValidationEngine() | |
{ | |
AllValidatorsInAssembly = new Dictionary<Type, IValidator>(); |
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
public class AlwaysUseHttps : IApplicationStartup | |
{ | |
private readonly IConfigurationService _config; | |
public AlwaysUseHttps(IConfigurationService config) | |
{ | |
_config = config; | |
} | |
public void Initialize(IPipelines pipelines) |
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
# Get the ID and security principal of the current user account | |
$myWindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$myWindowsPrincipal = new-object System.Security.Principal.WindowsPrincipal($myWindowsID) | |
# Get the security principal for the Administrator role | |
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator | |
# Check to see if we are currently running "as Administrator" | |
if ($myWindowsPrincipal.IsInRole($adminRole)) | |
{ |