Skip to content

Instantly share code, notes, and snippets.

@a4099181
a4099181 / Convert-ToPackageReference.ps1
Last active February 18, 2021 07:00
Converts packages.config into PackageReference at *.csproj project file. Requires XSLT stylesheet available as second file in the gist.
Function Convert-ToPackageReference
{
Param ( [Parameter( Mandatory, ValueFromPipeline )][String] $inputUri,
[String] $stylesheetUri = "https://gist.githubusercontent.com/a4099181/074a6c3dd524ea0d343382137492399c/raw/cdd0fb31efd70c4c0f8c86ddb314de86ab8972e8/Convert-ToPackageReference.xsl",
[String] $resultsFile = [System.IO.Path]::GetTempFileName() )
Process {
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load( $stylesheetUri )
$xslt.Transform( $inputUri, $resultsFile )
@atwayne
atwayne / teamcity.process.trigger.ps1
Created May 18, 2016 17:34
A powershell script to trigger TeamCity build via REST API
$user = "username"
$password = "password"
$teamCityHost = "http://teamcity:8082/"
$pair = "$($user):$($password)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$headers = @{
"Authorization" = $basicAuthValue;
"Accept" = "application/xml";
@geoffappleford
geoffappleford / gist:6087882
Created July 26, 2013 10:31
Fix for RazorGenerator custom tool not running in VS 2012
void Main()
{
var extFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), @"AppData\Local\Microsoft\VisualStudio\11.0\Extensions");
var source = Path.GetDirectoryName(Directory.GetFiles(extFolder, "*.dll", SearchOption.AllDirectories).FirstOrDefault(f => f.EndsWith("RazorGenerator.dll")));
var assemblyBaseFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), @"AppData\Local\assembly\dl3");
var assemblyFolders = Directory.GetFiles(assemblyBaseFolder, "*.dll", SearchOption.AllDirectories).Where(f => f.Contains("RazorGenerator"))
.Select(c => Path.GetDirectoryName(c));
foreach (var target in assemblyFolders){