Skip to content

Instantly share code, notes, and snippets.

<!-- This task takes in a XDT transform file and transforms it, following any inheritance chain.
There should be at least one base transform for this to work; otherwise just use Microsoft's
regular TransformXml task. -->
<!-- EXAMPLE USAGE:
<TransformXmlHierarchy
Source="source.xml"
Destination="transformed.xml"
TaskDirectory="path/to/directory/of/Microsoft.Web.Publishing.Tasks" />
-->
<UsingTask
@qbikez
qbikez / MimeMap.cs
Last active August 29, 2015 14:22 — forked from atifaziz/MimeMap.cs
#region Imports
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Configuration;
using System.IO;
#endregion
@qbikez
qbikez / convert-packagesconfig.ps1
Last active January 13, 2016 04:55 — forked from rossipedia/convert.ps1
packages.config -> project.json dependencies
(Select-xml '//package' -Path "packages.config" | % { """{0}"": ""{1}""" -f $_.Node.id,$_.Node.version }) -join ",`n"
@qbikez
qbikez / docker-start.cmd
Created February 4, 2016 09:50
docker-quickstart-terminal for CMD
@echo off
REM !/bin/bash
REM trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong... Press any key to continue..."' EXIT
set VM=default
set DOCKER_MACHINE="./docker-machine.exe"
REM if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
@qbikez
qbikez / color.bat
Created February 4, 2016 09:56
using colors in cmd console
echo off
REM SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
)
echo say the name of the colors, don't read
call :ColorText 0a "blue"
call :ColorText 0C "green"
call :ColorText 0b "red"
echo off
REM SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
)
echo say the name of the colors, don't read
call :ColorText 0a "blue"
call :ColorText 0C "green"
call :ColorText 0b "red"
@qbikez
qbikez / pyvm.cmd
Created February 5, 2016 10:15
python version manager - a simple version manager with hardcoded paths that can server as a template for future use, Can be used from PS or CMD.
@echo off
(echo REM pyvm.cmd) > "%TEMP%\_env.cmd"
powershell %~dp0\pyvm.ps1 %*
call "%TEMP%\_env.cmd"
@qbikez
qbikez / nuspec-tools.ps1
Created February 7, 2016 19:00
powershell helper functions for manipulating nuspec
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
}
@qbikez
qbikez / module.psm1
Created February 16, 2016 06:25
a template for creating powershell module
$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 February 19, 2016 09:26
psget with fixes for unattended use
#########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# PowerShellGet Module
#
#########################################################################################
Microsoft.PowerShell.Core\Set-StrictMode -Version Latest