Skip to content

Instantly share code, notes, and snippets.

View RichieBzzzt's full-sized avatar
🦆
Sirfetch'd

Richie Lee RichieBzzzt

🦆
Sirfetch'd
View GitHub Profile
param(
[parameter(Mandatory = $true)] [string]$functionName,
[parameter(Mandatory = $true)] [string]$appName,
[parameter(Mandatory = $true)] [string]$resourceGroup
)
function Get-KuduCredentials($appName, $resourceGroup) {
[xml]$x = Get-AzureRmWebAppPublishingProfile -ResourceGroupName $resourceGroup -Name $appName
$user = $x.publishData.publishProfile[1].userName.Split("\") | Select-Object -Last 1
param(
[parameter(Mandatory=$true)] [string]$functionName,
[parameter(Mandatory=$true)] [string]$appName,
[parameter(Mandatory=$true)] [string]$resourceGroup,
[parameter(Mandatory=$true)] [string]$key
)
function Get-KuduCredentials($appName, $resourceGroup) {
[xml]$x = Get-AzureRmWebAppPublishingProfile -ResourceGroupName $resourceGroup -Name $appName
Function Create-VstsRelease {
[CmdletBinding()]
param(
[string]
[ValidateNotNullOrEmpty()]
$vstsAccount
, [string]
[ValidateNotNullOrEmpty()]
$projectName
Function Install-ADAuthenticationLibraryforSQLServer {
# from https://bzzzt.io/post/2018-05-25-horrible-adalsql-issue/
$workingFolder = Join-Path $env:temp ([System.IO.Path]::GetRandomFileName())
New-Item -ItemType Directory -Force -Path $workingFolder
$uri = "https://raw.githubusercontent.com/RichieBzzzt/adalsqlmsi/master/msi/adalsql.msi"
$splitArray = $uri -split "/"
$fileName = $splitArray[-1]
Import-Module PoshSSDTBuildDeploy -Force
$GetDotNetVersion = Test-NetInstalled
$net471sdk = "https://download.microsoft.com/download/9/0/1/901B684B-659E-4CBD-BEC8-B3F06967C2E7/NDP471-DevPack-ENU.exe"
$net471 = "https://download.microsoft.com/download/9/E/6/9E63300C-0941-4B45-A0EC-0008F96DD480/NDP471-KB4033342-x86-x64-AllOS-ENU.exe"
If (!(Test-Path "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.1 Tools") ) {
$agentTempFolderName = Join-Path $env:temp ([System.IO.Path]::GetRandomFileName())
New-Item -ItemType Directory -Force -Path $agentTempFolderName
Write-Verbose "Temporary Agent download folder: $agentTempFolderName" -verbose
Install-DotNet -WorkingFolder $agentTempFolderName -uri $net471sdk
{
"type": "Microsoft.Sql/servers/firewallRules",
"kind": "v12.0",
"name": "[concat(variables('sqlServerName'), '/', variables('firewallRules_AllowAllAzureServices'))]",
"apiVersion": "2014-04-01-preview",
"location": "[resourceGroup().location]",
"scale": null,
"properties": {
"startIpAddress": "0.0.0.0",
#https://download.microsoft.com/download/0/6/4/064F84EA-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe
if ((Test-Path 'HKLM:\SOFTWARE\Classes\Installer\Dependencies\,,amd64,14.0,bundle\Dependents') -eq $false) {
Write-Host "No C++ Thingy installed. Installing..."
$vcRDist = "C:\Users\richardlee\Downloads\vc_redist.x64.exe"
$vcRDistArgs = {/install /quiet /norestart}
$process = Start-Process -Verb RunAs -Filepath $vcRDist -ArgumentList $vcRDistArgs -Wait -PassThru
Write-Host "Exit code: $($process.ExitCode)"
if ($process.ExitCode -ne 0 ) {
Write-Error "Oh dear!"
Throw
$VersionNumbers = @()
$VersionNumbers = "1.0.0", "1.0.0.0", "1.0.t", "1.0.0.t", "1.0.0.0.t" ,"1.0.0.5", "1.0.0.4567", "t.0.0.345", "1.rt.0.345"
$alphaRegex = "^(\d+\.)?(\d+\.)?(\*|\d+)$"
$ErrorActionPreference = "SilentlyContinue"
foreach ($semver in $VersionNumbers) {
Write-Host $semver -ForegroundColor Green
if (($semver -match $alphaRegex) -eq $false) {
$betaRegex = "^(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)$"
if (($semver -match $betaRegex) -eq $false) {
<Target Name="DevEnvInstaller">
<PropertyGroup>
<DevEnv>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com</DevEnv>
<SolutionFile>$(SolutionRoot)\Database\Ispac\SSISPackages.sln</SolutionFile>
<ProjectFile>$(SolutionRoot)\Database\ISPac\SSISPackages\ETLBulkLoader.dtproj</ProjectFile>
<Configuration>Release</Configuration>
</PropertyGroup>
<Exec>
Command="&quot;$(devenv)&quot; &quot;$(SolutionFile)&quot; /Rebuild &quot;$(Configuration)&quot; /Project &quot;$(ProjectFile)&quot; /ProjectConfig &quot;$(Configuration)&quot; /Log"
#azfun init MyFunctionProj
if ((Test-Path "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0") -eq $false) {
Write-Host "No Net Core 2.0 SDK installed. Installing..."
$NetCore = "C:\Users\richardlee\Downloads\dotnet-sdk-2.0.0-win-x64.exe"
$NetCoreArgs = {/install /quiet /norestart}
$process = Start-Process -Verb RunAs -Filepath $NetCore -ArgumentList $NetCoreArgs -Wait -PassThru
Write-Host "Exit code: $($process.ExitCode)"
if ($process.ExitCode -ne 0 ){
Write-Error "Oh dear!"
Throw