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 static IntPtr GetTerminalWindowHandle() | |
{ | |
try | |
{ | |
var currentProcess = Process.GetCurrentProcess(); | |
do | |
{ | |
var parentProcess = GetParentProcess(currentProcess.Handle); | |
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
#!/bin/bash | |
# Função para verificar BOM UTF-8 | |
check_bom() { | |
local file=$1 | |
if [[ $(head -c 3 "$file") == $'\xEF\xBB\xBF' ]]; then | |
return 0 | |
else | |
return 1 | |
fi |
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
class MBStringComparer : System.Collections.IComparer { | |
[int] Compare([object] $x, [object] $y) { | |
if($x.Contains('/')) | |
{ | |
$x = $x.Substring($x.LastIndexOf('/') + 1) | |
} | |
if($y.Contains('/')) | |
{ |
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
@description('Specifies the name of the Azure Storage account.') | |
param storageAccountName string | |
@description('Specifies the name of the blob container.') | |
param containerName string = 'tfstate' | |
@description('Specifies the location in which the Azure Storage resources should be deployed.') | |
param location string = resourceGroup().location | |
@description('Specifies the SKU for the Storage Account.') |
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
#requires -Modules TfsCmdlets | |
<# | |
.SYNOPSIS | |
Modifies the settings of a Git repository. | |
#> | |
Function Set-TfsGitRepositorySetting { | |
[CmdletBinding(SupportsShouldProcess = $true)] | |
Param ( | |
# Specifies the name of the setting to modify. |
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
<# | |
.SYNOPSIS | |
Gets the settings of a Git repository. | |
#> | |
Function Get-TfsGitRepositorySetting { | |
[CmdletBinding()] | |
Param ( | |
# Specifies the name of the setting to retrieve. If not specified, all settings are returned. | |
[Parameter(Position = 0)] | |
[SupportsWildcards()] |
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 | |
( | |
# URL to the Azure DevOps incoming webhook endpoint. Expected format is | |
# https://dev.azure.com/<org>/_apis/public/distributedtask/webhooks/<svc-trig>/?api-version=6.0-preview. | |
[uri] | |
$Url, | |
# Shared secret used to sign the JSON payload. Must be the same value supplied during | |
# the creation of the Incoming Webhook service connection | |
[string] |
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] | |
$AgentZip = 'agent.zip', | |
[string] | |
$AgentDirectory = "$($env:SystemDrive\Agent)", | |
[Parameter(Mandatory=$true)] | |
[string] | |
$DeploymentPoolName, |
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
trigger: | |
- master | |
resources: | |
- repo: self | |
variables: | |
azureSubscription: '<azure-subscription>' | |
dockerRegistryServiceConnection: '<service-connection>' | |
imageRepository: '<repository-name>' |
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
Function Get-IfNull($Value, $DefaultValue) | |
{ | |
if($Value -eq $null) | |
{ | |
return $DefaultValue | |
} | |
return $Value | |
} | |
Set-Alias '??' Get-IfNull |
NewerOlder