View pfxtosnk.cs
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
X509Certificate2 cert = new X509Certificate2(@"KEY.pfx", "pfxPassword", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet); | |
RSACryptoServiceProvider provider = (RSACryptoServiceProvider) cert.PrivateKey; | |
byte[] array = provider.ExportCspBlob(!provider.PublicOnly); | |
using (FileStream fs = new FileStream("FileName.snk", FileMode.Create, FileAccess.Write)) | |
{ | |
fs.Write(array, 0, array.Length); | |
} |
View FeatureVersionIncrementer.ps1
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
[System.Reflection.Assembly]::Load("Microsoft.VisualStudio.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); | |
[System.Reflection.Assembly]::Load("Microsoft.VisualStudio.SharePoint.Designers.Models.Features, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); | |
$featureFiles = get-childitem -Filter "*.feature" -Recurse; | |
$featureTemplateFiles = get-childitem -Filter "*.Template.xml" -Recurse | Where-Object {$_.Directory.Name -ne "Package"} | |
$featureRegex = [Regex]"(?<buildnumber>\d{1,4}\.\d{1,4}\.\d{1,4}\.\d{1,4})"; | |
$templateRegex = [Regex]'EndVersion=\"(?<buildnumber>\d{1,4}\.\d{1,4}\.\d{1,4}\.\d{1,4})\"'; | |
function getVersionObject($stringVersion) | |
{ |
View gittfsmigrationcleanup.ps1
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([string]$targetPath) | |
$targetSearchPath = $targetPath+"\*" | |
remove-item $targetSearchPath -Recurse -include *.vspscc,*.vssscc -Verbose | |
$slnRegexPattern = 'GlobalSection\(TeamFoundationVersionControl\)[:\w\d\s\\.=\/{}-]*EndGlobalSection' | |
$slnFiles = get-childitem -Path $targetSearchPath -Recurse -Filter *.sln | |
foreach($slnFile in $slnFiles) | |
{ | |
$content = get-content $slnFile.FullName -Raw | |
if($content -match $slnRegexPattern) | |
{ |
View PublishAspNet5Website.ps1
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($websiteName, $packOutput, $slot) | |
#fix for the script provided here https://msdn.microsoft.com/en-us/Library/vs/alm/Build/azure/deploy-aspnet5?f=255&MSPPError=-2147217396 | |
$website = $null; | |
$baseUrl = $websiteName; | |
if($slot -eq $null){ | |
$website = Get-AzureWebsite -Name $websiteName | |
} else { | |
$baseUrl += "-" + $slot | |
$website = Get-AzureWebsite -Name $websiteName -Slot $slot | |
} |
View RunTests.ps1
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
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))} | |
# load up the global.json so we can find the DNX version | |
$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore | |
if($globalJson) | |
{ | |
$dnxVersion = $globalJson.sdk.version | |
} | |
else |
View Startupupdate.cs
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 Microsoft.Data.Entity; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace YourDbContextNameSpace | |
{ | |
public class Startupupdate | |
{ | |
public Startupupdate() | |
{ |
View UpdateDatabase.ps1
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([string]$connectionString) | |
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))} | |
# load up the global.json so we can find the DNX version | |
$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore | |
if($globalJson) | |
{ | |
$dnxVersion = $globalJson.sdk.version | |
} |
View ArgumentNullRefExceptionReplace.cs
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
ArgumentNullException\("(\w+)"\); | |
ArgumentNullException(nameof($1)); |
OlderNewer