Skip to content

Instantly share code, notes, and snippets.

qbik qbikez

Block or report user

Report or block qbikez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@qbikez
qbikez / module.psm1
Created Feb 16, 2016
a template for creating powershell module
View module.psm1
$root = "."
if (![string]::IsNullOrEmpty($PSScriptRoot)) {
$root = $PSScriptRoot
}
#if ($MyInvocation.MyCommand.Definition -ne $null) {
# $root = $MyInvocation.MyCommand.Definition
#}
$helpersPath = $root
# grab functions from files
@qbikez
qbikez / PSGet.psm1
Last active Feb 19, 2016
psget with fixes for unattended use
View PSGet.psm1
#########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# PowerShellGet Module
#
#########################################################################################
Microsoft.PowerShell.Core\Set-StrictMode -Version Latest
@qbikez
qbikez / PSGet5.psm1
Created Feb 17, 2016
psget - powershell v5
View PSGet5.psm1
#########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# PowerShellGet Module
#
#########################################################################################
Microsoft.PowerShell.Core\Set-StrictMode -Version Latest
@qbikez
qbikez / clone-hg.ps1
Last active Feb 22, 2016
a script to incrementally clone hg repo (for HUUGE repos)
View clone-hg.ps1
[cmdletbinding()]
param(
[Parameter(Mandatory=$true)]$repo,
[Parameter(Mandatory=$true)]$targetdir,
$offset = 0,
$batchsize = 50,
$total = 40000
)
@qbikez
qbikez / example.tests.ps1
Last active Feb 27, 2016 — forked from nohwnd/example.tests.ps1
Pester problem matcher for VS Code
View example.tests.ps1
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"}
}
View hg-repo-conversion
Some powershell scripts helpful in mercurial repository conversion
@qbikez
qbikez / perfcounters.ps1
Created Mar 3, 2017
a little Powershell Cmdle that makes performance measuring easier.
View perfcounters.ps1
$script:perfstack = @()
$fullperfnames = $false
function measure-function([string] $__name, [scriptblock] $__command) {
$__result = $null
$__cmd = {
$__result = Invoke-Command $__command
}
if ($script:perfstack -eq $null) {
You can’t perform that action at this time.