Skip to content

Instantly share code, notes, and snippets.

@nonbob
nonbob / CompileAndMessWithVfgUtil.ps1
Last active August 27, 2024 23:08
Beginning of a utility class for reading Vernier .gambl files in a .NET context, leaning toward PowerShell
# the C# file that goes with this is intended to be used with Add-Type
# this may partly explain the quirky coding style
# everything I know about gambl files is reverse-engineered, so the names are just wild guesses
# the part that's done in C# definitely could have been done in PowerShell
# but I'm messing with a lot of these files, so I wanted it to be more efficient
# also, it was an excuse to play with memory-mapped files in .NET, which I hadn't done before
# the dll and exe locationss are based on having done
# NuGet Install Microsoft.CodeDom.Providers.DotNetCompilerPlatform
@nonbob
nonbob / RunPSWithSoapLogger.ps1
Created August 17, 2022 02:31
logging for New-WebServiceProxy
# after examining a number of approaches, I decided this was the shortest, sturdiest jengastack
# of kludges that would get me to where I wanted to go. If anybody knows a better approach,
# please ping me.
# this script is meant to be pasted into a command-line PowerShell 5.1 prompt.
# It creates a throw-away executable (and accompanying config file) in $env:temp.
# It also creates a throw-away nested invocation of PowerShell. It logs to
# $env:temp\SoapLogyyyyMMddHHmmss.txt
Remove-Item $env:temp\RunPSWithSoapExtension.exe -ea 0
@nonbob
nonbob / Enter-VSBuildShell.ps1
Created January 2, 2020 16:04
Enter-VSBuildShell - invoke Enter-VsDevShell with the instance id appropriate to the build environment
# Microsoft may already have a version of this, but I haven't found it yet
# The class of people who need this and haven't already created it for themselves may be rather narrow but. . .
# what the heck. Perhaps those of us who have created versions can get together in gistspace and produce a
# more featureful, robust version
<#
.SYNOPSIS
Invoke Enter-VsDevShell using the instance most appropriate to the build environment
.DESCRIPTION
Locates installed Visual Studio instances using vswhere, selects them using $vintage (which default to 2019)