Skip to content

Instantly share code, notes, and snippets.

View jawn's full-sized avatar
✔️
Probably sending a PR for typos.

Bernard Vander Beken jawn

✔️
Probably sending a PR for typos.
View GitHub Profile
@jstangroome
jstangroome / gist:785710
Created January 19, 2011 04:57
Download a file from TFS 2010 source control via PowerShell
$CollectionUrl = 'http://localhost:8080/tfs/defaultcollection'
Add-Type -AssemblyName 'Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Add-Type -AssemblyName 'Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
$Collection = New-Object -TypeName Microsoft.TeamFoundation.Client.TfsTeamProjectCollection -ArgumentList $CollectionUrl
$VersionControl = $Collection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
$DestinationFile = [IO.Path]::GetTempFileName()
$VersionControl.DownloadFile('$/Test/BuildProcessTemplates/DefaultTemplate.xaml', $DestinationFile)
@PaulStovell
PaulStovell / PowerShell invoker.cs
Created February 26, 2013 12:00
Invoking PowerShell, with variables
using System;
using System.IO;
using System.IO.IsolatedStorage;
using System.Management.Automation;
using System.Text;
using PowerShellHosting.Util;
namespace PowerShellHosting.File
{
public class FileBasedPowerShellRunner : IPowerShell
@jongalloway
jongalloway / PcRepave.cmd
Last active February 23, 2023 18:02
Chocolatey list generated using: choco list --localonly --idonly
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco feature enable -n allowGlobalConfirmation
choco install 7zip /y
choco install 7zip.install /y
choco install ARMClient /y
choco install audacity /y
choco install audacity-lame /y
choco install autohotkey /y
choco install autohotkey.install /y
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}
@bryan-c-oconnell
bryan-c-oconnell / RestApiTest.ps1
Last active February 8, 2021 07:53
bryanoconnell.blogspot.com - Test your RESTful API using PowerShell
# |Info|
# Written by Bryan O'Connell, November 2014
# Purpose: Sample of a functional test script for a RESTful API.
#
# Thanks to contributors on the 'jsonplaceholder' project for making a publicly
# accesible and generic REST API (which is used in the examples below).
# - http://jsonplaceholder.typicode.com
# - https://github.com/typicode/jsonplaceholder
#
# |Info|
@bryan-c-oconnell
bryan-c-oconnell / ExcelExtract.ps1
Last active November 10, 2015 14:18
bryanoconnell.blogspot.com - Extract worksheets from Excel into separate files with PowerShell
# |Info|
# Written by Bryan O'Connell, September 2012
# Purpose: Extract all of the worksheets from an Excel file into separate files.
# Sample command: PowerShell.exe xls_extract.ps1 -filepath "C:\Spreadsheet.xls" -output_type "csv"
# Params:
# -filepath: The Excel file you want to extract worksheets from.
# -output_type: The filetype to save the Worksheets as (can be csv, txt, xls, html).
# |Info|
[CmdletBinding()]
@NickCraver
NickCraver / Windows10-Setup.ps1
Last active August 1, 2024 16:19
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@mgirardot
mgirardot / Lego_sets.adoc
Last active April 6, 2022 08:02
Managing your Lego collection

Build Star Wars models with your Lego collection

Summary

Since my childhood, the countless model building with Lego bricks are fascinating me. Lego are plastic construction toys consisting of interlocking bricks that are used to construct a wide variety of models. Usually, Lego are sold as a collection of different designed pieces and an instruction book that visually describe the sequential building steps of a miniature model.

I always had a great fun using bricks to build different models that you have to imagine based on the bricks available. But this liberty to imagine new models comes with a great frustration when important pieces are missing to build it.

@cmendible
cmendible / VersionTelemetryInitializer.cs
Last active October 28, 2020 15:23
Application Insights Telemetry Initializer to send the application version and a custom "tags" property
namespace Insights
{
using System.Configuration;
using System.Linq;
using System.Reflection;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
/// <summary>
/// Version TelemetryInitializer
@Sarafian
Sarafian / Export-ModuleDocumentation.ps1
Created January 16, 2017 12:06
Export a module's documentation in markdown
#requires -module platyPS
<#
.SYNOPSIS
Export a module's documentation in markdown.
.DESCRIPTION
Export a module's documentation in markdown.