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 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 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 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)); |
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 bringImportedRepoBranchesBackToForked.sh
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
git remote add downstream UrlOfImportedRepo | |
#foreach branch you want to bring back | |
git fetch downstream/branchname | |
git checkout branchname | |
git merge downstream/branchname #hopefully your history is not a mess and you don’t have conflicts to handle | |
git push origin | |
#end of foreach | |
git remote remove downstream |
View office365clirefactor.ts
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 mapNpmCommand(command: string, packagesDevExact: string[], | |
packagesDevInexact: string[], packagesDepExact: string[], packagesDepInexact: string[], | |
packagesDepUn: string[], packagesDevUn: string[]): void { | |
const npmReduceRegex: RegExp = /npm\s+(i|un)\s+([\w\d\@\/\.-]+)\s+(-D|-S)?\s?(-E)?/gm; | |
const npmReduceMatch: RegExpExecArray | null = npmReduceRegex.exec(command); | |
const packageNameGroupId: number = 2; | |
const installCommandGroupId: number = 1; | |
const dependencyCategoryGroupId: number = 3; | |
const exactGroupId: number = 4; | |
if (npmReduceMatch) { |
OlderNewer