This file contains hidden or 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
| - bash: | # Access Token should need Build Read, Work Item Read & Write, Member Entitlement Management Read | |
| curl -u [email protected]:access-token-xxxxxxxxxxx https://dev.azure.com/{organisation}/{project}/_apis/build/builds/$(build.buildId)/workitems?api-version=6.0 | jq '.value[] | .id' | | |
| while IFS=$"\n" read -r c; do | |
| wid=$(echo $c | tr -dc '0-9') | |
| echo | |
| echo Posting status to work item: $wid | |
| echo | |
| curl -u [email protected]:access-token-xxxxxxxxxxx https://dev.azure.com/{organisation}/{project}/_apis/wit/workItems/$wid/comments?api-version=6.0-preview.3 -X POST --data '{"text": "Build $(Build.BuildNumber) completed with status: $(Agent.JobStatus)"}' -H 'Content-Type: application/json' | |
| echo | |
| done |
This file contains hidden or 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
| # Usage: powershell ExportSchema.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>" | |
| # Start Script | |
| Set-ExecutionPolicy RemoteSigned | |
| # Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine | |
| function GenerateDBScript([string]$serverName, [string]$dbname, [string]$scriptpath) | |
| { | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null |
This file contains hidden or 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
| #================================================================================= | |
| # Designed to deploy a database from a dacpac | |
| # | |
| # Usage: | |
| # .\sqlPackageDeploymentCMD.ps1 -targetServer "LOCALHOST" -targetDB "IamADatabase" -sourceFile "C:\ProjectDirectory\bin\Debug\IamADatabase.dacpac" -SQLCMDVariable1 "IamASQLCMDVariableValue" | |
| # | |
| # So, why would you do this when you could just call the sqlpackage.exe directly? | |
| # Because Powershell provides a higher level of orchestration; I plan to call this script from another script that | |
| # first calls a script to build the dacpac that is then used in this script. | |
| #================================================================================= |
This file contains hidden or 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
| # Download latest dotnet/codeformatter release from github | |
| $repo = "jgm/pandoc" | |
| $filenamePattern = "*x86_64.zip" | |
| $pathExtract = "C:\Tools\pandoc" | |
| $innerDirectory = $true | |
| $preRelease = $false | |
| if ($preRelease) { | |
| $releasesUri = "https://api.github.com/repos/$repo/releases" |
This file contains hidden or 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
| // Promise.all is good for executing many promises at once | |
| Promise.all([ | |
| promise1, | |
| promise2 | |
| ]); | |
| // Promise.resolve is good for wrapping synchronous code | |
| Promise.resolve().then(function () { | |
| if (somethingIsNotRight()) { | |
| throw new Error("I will be rejected asynchronously!"); |
This file contains hidden or 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
| // RS relies on some buggy IE functionality - that overflow should be visible by default (which is not standard) | |
| // So Webkit based browsers don't show the report correctly as they hide overflow by default | |
| // We need to set overflow visible for the report div | |
| var deadman=60; | |
| function makeReportVisible() { | |
| if (typeof($) !== "undefined") { | |
| var div = $('table[id*=_fixedTable] > tbody > tr:last > td:last > div') | |
| if(div) { | |
| div.css('overflow', 'visible'); |
This file contains hidden or 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-HyperVServersInDomain { | |
| [cmdletbinding()] | |
| param( | |
| ) | |
| try { | |
| Import-Module ActiveDirectory -ErrorAction Stop | |
| } | |
| catch { | |
| Write-Warning "Failed to import Active Directory module. Exiting" | |
| return |
This file contains hidden or 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
| # Usage: powershell ExtractInitialDatabaseScript.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>" | |
| function GenerateDBScript([string]$ServerName, [string]$Database, [string]$scriptpath) | |
| { | |
| $outFile = "$scriptpath\$($Database)_Inital_setup.sql" | |
| if (-not (Test-Path $scriptpath)) { | |
| [System.IO.Directory]::CreateDirectory($scriptpath) | |
| } | |
| If (Test-Path $outFile) { | |
| Remove-Item $outFile |
This file contains hidden or 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 | |
| General-purpose Octopus Deploy boostrapper | |
| Binds Octopus variables directly on to parameters on an install script, passing the rest as a hashtable | |
| This means your Install script can itself have 'proper' parameters, making local testing easier | |
| #> | |
| param( | |
| $entryPoint = '.\Install.ps1' | |
| ) |
This file contains hidden or 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
| version: "3.2" | |
| # docker stack deploy --compose-file docker-compose.yml build | |
| services: | |
| my-test-server: | |
| image: nginx | |
| ports: | |
| - "80" | |
| volumes: | |
| - my-test-store-s3:/usr/share/nginx/html/s3:ro | |
| networks: |
NewerOlder