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
$basepath = "C:\tmp\bmBlog\content" | |
$files = Get-ChildItem -path $basepath -Filter "*.md" -Recurse | % { $_.FullName} | |
foreach ($file in $files) { | |
$f = get-item $file | |
$content = (Get-Content -path $f.FullName) | |
foreach ($l in $content) { | |
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
'use strict'; | |
/*** | |
Usage: blog2md b|w <BLOGGER/WordPress BACKUP XML> <OUTPUT DIR> | |
*/ | |
const fs = require('fs'); | |
const os = require('os'); |
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
pool: | |
vmImage: windows-latest | |
variables: | |
- name: system.debug | |
value: true | |
stages: | |
- stage: Stage1 | |
jobs: |
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
parameters: | |
- name: Value | |
type: boolean | |
default: true | |
pool: | |
vmImage: ubuntu-latest | |
stages: |
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,HelpMessage="The target Azure DevOps Instance")] | |
$org, | |
[parameter(Mandatory=$true,HelpMessage="The new project name")] | |
$projectName, | |
[parameter(Mandatory=$true,HelpMessage="A PAT with access to target org")] | |
$pat |
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
name: Add Issue to project | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
track_issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get project data |
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 | |
( | |
$tagname, | |
$trunk = 'main' | |
) | |
& git push origin :refs/tags/$tagname | |
& git tag -fa $tagname -m "Current $tagname release" | |
& git push origin $trunk --tags |
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
try { | |
# this block is in its own try/catch as it uses undocumented API calls, so will fail safe | |
# we need to stage ID which is only available via a REST call | |
$uri = "$(System.CollectionUri)/$(System.TeamProject)/_apis/build/builds/$(Build.BuildID)/timeline?api-version=6.0" | |
$response = Get-WebClient.DownloadString($uri) | ConvertFrom-Json | |
$stage = $response.records | where-object -property name -eq "$(System.StageName)" | |
# now we can get the approval, we have to use a new webclient instance else you get a 400 Bad Request error | |
$uri = "$(System.CollectionUri)_apis/Contribution/HierarchyQuery/project/$(System.TeamProject)?api-version=6.1-preview.1" | |
$payload = "{`"contributionIds`":[`"ms.vss-build-web.checks-panel-data-provider`"],`"dataProviderContext`":{`"properties`":{`"buildId`":`"$(Build.BuildID)`",`"stageIds`":`"$($stage.id)`",`"checkListItemType`":1,`"sourcePage`":{`"url`":`"$(System.CollectionUri)/$(System.TeamProject)/_build/results?buildId=$(Build.BuildID)&view=results`",`"routeId`":`"ms.vss-bui |
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
# To set as Git Alias | |
# git config --global alias.tidy "!pwsh -command C:\MyFolder\Remove-DeletedGitBranches.ps1" | |
param | |
( | |
[Parameter()] | |
[Switch] | |
$Force | |
) | |
Write-Host "Getting list of branches" |
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
configuration BuildAgent { | |
param ( | |
[ValidateNotNull()] | |
[System.Management.Automation.PSCredential]$Credential, | |
[string]$EnvPrefix, | |
[Int]$RetryCount = 100, | |
[Int]$RetryIntervalSec = 30 | |
) |