Skip to content

Instantly share code, notes, and snippets.

🦆
Sirfetch'd

Richie Lee RichieBzzzt

🦆
Sirfetch'd
View GitHub Profile
View getallusersinaadgroups.ps1
if ($null -eq (Get-AzContext)) {
Write-Host "No Azure Context... logging in."
Login-AzAccount -UseDeviceAuthentication
}
$groups = @("bob","tim"
)
$outputPath = ""
View publish_artifact.ps1
[CmdletBinding()]
param (
[string]$packageSourceUrl = 'https://pkgs.dev.azure.com/[orgname]/[randomguid]/_packaging/[feedname]/nuget/v3/index.json',
[string]$AzDOArtifactFeedName = '[feedname]',
[string]$AzDOPat,
[string]$ModuleFolderPath = (Join-Path -Path $env:SYSTEM_ARTIFACTSDIRECTORY -ChildPath "[.artifact.alias]\[folder.what.contains.module]")
)
# Variables
$feedUsername = 'NotChecked'
View Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0
#Requires -Module AzureRM.Resources
#Requires -Module Azure.Storage
#Requires -Module @{ModuleName="AzureRm.Profile";ModuleVersion="3.0"}
Param(
[string] [Parameter(Mandatory = $true)] $ArtifactStagingDirectory,
[string] [Parameter(Mandatory = $true)][alias("ResourceGroupLocation")] $Location,
[string] $ResourceGroupName = (Split-Path $ArtifactStagingDirectory -Leaf),
[switch] $UploadArtifacts,
View irgofaster.ps1
param(
[string]
$numberOfConcurrentActivities
)
$registryPath = "HKLM:\SOFTWARE\Microsoft\DataTransfer\DataManagementGateway\Gateway"
$Name = "WorkerProcessCount"
if (($numberOfConcurrentActivities -match "^[\d\.]+$") -eq $false)
{
Write-Error "Number of concurrent activites needss to be a number."
Throw
View setlocalnotebook_falsedirectdownload.ps1
function Set-LocalNotebook ($DatabricksFile, $Language, $LocalOutputPath, $Format = "SOURCE") {
$DatabricksFileForUrl = Format-DataBricksFileName -DataBricksFile $DatabricksFile
$uri = "$global:DatabricksURI/api/2.0/workspace/export?path=" + $DatabricksFileForUrl + "&format=$Format&direct_download=false"
switch ($Format) {
"SOURCE" {
$FileExtentions = @{"PYTHON" = ".py"; "SCALA" = ".scala"; "SQL" = ".sql"; "R" = ".r" }
$FileExt = $FileExtentions[$Language]
}
"HTML" {
View bosh.ps1
$aadConnectionString = "Server=tcp:$($AzureSqlFQDN),1433;Initial Catalog=myLittleDatabbase;Persist Security Info=False;User ID=$($aadAdminUser);Password=$($aadAdminPassword);MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication=""Active Directory Password"";"
@RichieBzzzt
RichieBzzzt / keyvault_arm_with_access_policy.json
Created Jul 24, 2019
part of arm template for deploying keyvault
View keyvault_arm_with_access_policy.json
{
"type": "Microsoft.KeyVault/vaults",
"name": "[parameters('keyVaultName')]",
"apiVersion": "2018-02-14",
"location": "[resourceGroup().location]",
"tags": {},
"scale": null,
"properties": {
"sku": {
"family": "A",
View InvokeMsBuildSSDTIncDacpacRootPathBasic.ps1
function Invoke-MsBuildSSDT {
<#
.SYNOPSIS
Build a datbase project/solution using Microsoft.Data.Tools.MSBuild
.DESCRIPTION
Using MSBUild, the database project/solution is comiled using Microsoft.Data.Tools.MSBuild. This can be downloaded by using Install-MicrosoftDataToolsMSBuild
.PARAMETER DatabaseSolutionFilePath
Mandatory - Filepath to the sln/sqlproj file.
View syncCredntials.ps1
$subscriptionId = ''
$resourceGroupName = ''
$factoryName = ''
$integrationRuntimeNames = @('', '')
$ErrorActionPreference = "Stop"
try{
Get-AzureRmSubscription -SubscriptionId $subscriptionId -ErrorVariable nosession
}
catch {}
if ($nosession) {
View Disable_pipelinetrigger.ps1
param(
[parameter(Mandatory = $true)] [string]$ResourceGroupName,
[parameter(Mandatory = $true)] [string]$dataFactoryName,
[parameter(Mandatory = $true)] [string]$location,
[parameter(Mandatory = $false)] [string]$environmentsuffix,
[parameter(Mandatory = $false)] [string]$clientID,
[parameter(Mandatory = $false)] [string]$tenantID,
[parameter(Mandatory = $false)] [string]$key
)
You can’t perform that action at this time.