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
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using Microsoft.ApplicationInsights; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
using Microsoft.Extensions.Logging; | |
namespace Telemetry |
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
$script:perfstack = @() | |
$fullperfnames = $false | |
function measure-function([string] $__name, [scriptblock] $__command) { | |
$__result = $null | |
$__cmd = { | |
$__result = Invoke-Command $__command | |
} | |
if ($script:perfstack -eq $null) { |
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
Some powershell scripts helpful in mercurial repository conversion |
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
describe "DS"{ | |
it "skipped" {} -skip | |
it "pending" {} -Pending | |
It "throw" { throw "sdfad" } | |
It "assertion fail" {1 | should be 10 } | |
It "string assertion fail" {"asdf" | should be "ffsad" } | |
it "success" {"adsf"} | |
} |
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
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory=$true)]$repo, | |
[Parameter(Mandatory=$true)]$targetdir, | |
$offset = 0, | |
$batchsize = 50, | |
$total = 40000 | |
) | |
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
######################################################################################### | |
# | |
# Copyright (c) Microsoft Corporation. All rights reserved. | |
# | |
# PowerShellGet Module | |
# | |
######################################################################################### | |
Microsoft.PowerShell.Core\Set-StrictMode -Version Latest |
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
######################################################################################### | |
# | |
# Copyright (c) Microsoft Corporation. All rights reserved. | |
# | |
# PowerShellGet Module | |
# | |
######################################################################################### | |
Microsoft.PowerShell.Core\Set-StrictMode -Version Latest |
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
$root = "." | |
if (![string]::IsNullOrEmpty($PSScriptRoot)) { | |
$root = $PSScriptRoot | |
} | |
#if ($MyInvocation.MyCommand.Definition -ne $null) { | |
# $root = $MyInvocation.MyCommand.Definition | |
#} | |
$helpersPath = $root | |
# grab functions from files |
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
[CmdletBinding()] | |
param ($path = ".", [switch][bool]$importonly) | |
function get-envinfo($checkcommands) { | |
$result = @{} | |
write-verbose "Powershell version:" | |
$result.PSVersion = $PSVersionTable.PSVersion | |
$result.PSVersion | format-table | out-string | write-verbose |
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-NuspecVersion($nuspec = $null) { | |
if ([string]::IsNullOrEmpty($nuspec)) { | |
$nuspec = Get-ChildItem . -Filter *.nuspec | select -First 1 | |
} | |
$content = Get-Content $nuspec | |
$verRegex = "<version>(.*)</version>" | |
[string]$line = $content | where { $_ -match $verRegex } | select -First 1 | |
$ver = $matches[1] | |
return $ver | |
} |
NewerOlder