Skip to content

Instantly share code, notes, and snippets.

Avatar

Arthur Heidt ArthurHNL

View GitHub Profile
@ArthurHNL
ArthurHNL / EnterVSDevshell.ps1
Created Oct 28, 2019
A few lines of powershell code that enters the Visual Studio Developer PowerShell.
View EnterVSDevshell.ps1
$vsPath = &(Join-Path ${env:ProgramFiles(x86)} "\Microsoft Visual Studio\Installer\vswhere.exe") -property installationpath
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation
@ArthurHNL
ArthurHNL / DebuggingSerialize.cs
Created Oct 28, 2019
Paste this in the immediate window of VS during a debugging session of a C# project to immideatly serialize an object to JSON. For this to work, Newtonsoft.Json must be present in the current AppDomain.
View DebuggingSerialize.cs
global::System.IO.File.WriteAllText("temp.json", global::Newtonsoft.Json.JsonConvert.SerializeObject(variableName));
@ArthurHNL
ArthurHNL / VSDevShell.ps1
Created Sep 23, 2019
Enter VSDevShell from a stand-alone powershell script
View VSDevShell.ps1
$vsPath = &(Join-Path ${env:ProgramFiles(x86)} "\Microsoft Visual Studio\Installer\vswhere.exe") -property installationpath
Import-Module (Join-Path $vsPath "Common7\Tools\vsdevshell\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation
@ArthurHNL
ArthurHNL / VATVerify.php
Last active Aug 22, 2019
EU VIES VAT Verification
View VATVerify.php
<?php
// (c) Arthur Heidt, 2019. Licensed under MIT.
// There is no guarantee that this code works, I have not tested it.
// But it should at least point you in the right direction.
// You must enable the SOAP extension to allow this extension to work.
/**
* Verifies a VAT number using the EU VIES API.
*
* @param string $countryCode The country code for the company of which the VAT number must be
@ArthurHNL
ArthurHNL / RemoveAllUWPAppsExceptStore.ps1
Last active Sep 11, 2019
PowerShell oneliner that removes all UWP apps except the Microsoft Store. I run it after every "fresh" Windows 10 installation.
View RemoveAllUWPAppsExceptStore.ps1
Get-AppxPackage -AllUsers | Where-Object {$_.name –notlike "*store*"} | Remove-AppxPackage