View Delete_Remote_Branch_By_NamePattern.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
/* | |
ATENÇÃO: Esse comando não verifica se as alterações forma mescladas com a branch principal!! O branch vai ser apagado | |
*/ | |
param( | |
[Parameter(Mandatory=$true)] | |
[String]$branchNamePattern, | |
$remoteName = 'origin') | |
git branch --all --merged | Select-String -Pattern $branchNamePattern | |
| %{$_.ToString().Replace("remotes/$remoteName/",'').Trim()} | |
| %{ git push origin :$_ } |
View scale_up_and_down_alldeployment.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( | |
[Parameter(Mandatory=$true)][System.String] $namespace, | |
[Parameter(Mandatory=$true)][int]$numberOfReplicas | |
) | |
kubectl get deployments -n $namespace --output jsonpath="{range .items[*]}{.metadata.name}{'\n'}{end}" |%{ | |
kubectl scale deployment/$_ -n $namespace --replicas $numberOfReplicas; | |
} |
View AddOrUpdateTableAndColumnDescription
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
CREATE PROCEDURE dbo.PROC_AddOrUpdateTableAndColumnDescription | |
@fullName varchar(255), | |
@description varchar(255) | |
AS | |
/* | |
Table exemple: <schema>.<table name> dbo.MyTable | |
Column Exemple: <schema>.<table name>.<column name> dbo.MyTable.Id | |
*/ | |
/*Extrai o primeiro valor antes do ponto, representa o schema*/ |
View azure-storage-file-as-windows-disk.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
# This script help you setting an azure storage account as a network folder or windows disk | |
# Is need Azure CLI installed | |
param( | |
[System.String] | |
$resourceGroupName = "<resource group>", | |
[System.String] | |
$storageAccountName = "<storage account name>", | |
[System.String] | |
$subscription = "<subscription name or id>", |
View Cleanup-Azure-Container-Registry.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( | |
[Parameter(Mandatory=$true)] $acrAccountName, | |
$takeLastImages = 5, | |
$likeRepositories = '', | |
$selectTagPattern = '^([0-9]+(\.)?){3,4}$' | |
) | |
#Get all repository where the name like with parameter $likeRepositories | |
$repositories = az acr repository list --name $acrAccountName --query ("[?contains(@, '" + $likeRepositories + "')]") | ConvertFrom-Json ; |
View azure-database-export.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
#Esse script pode ser utilizado em tarefa do AzureDevOps para executar o backup da base de dados dentro do processo de Build ou Release | |
param( | |
$BaseStorageUri = "https://<your-storage>.blob.core.windows.net/backup-database", | |
$StorageKey = "<Shared key>", | |
$DatabaseName = @( "db1","db2","db3"), | |
$ResourceGroupName = "<database-resource-group-name>", | |
$ServerName = "<database-server-name>", | |
$serverAdmin = "<database-user-with-permission-login>", | |
$serverPassword = "<database-user-with-permission-password>" |