Skip to content

Instantly share code, notes, and snippets.

@nickcox
nickcox / timever.ps1
Created May 23, 2021 22:39
Timever compatible version string
# get a version string based on the current date & time
# https://gist.github.com/twolfson/de1b004dd22536b8e668
(Get-Date -AsUTC).ToString('yyyyMMdd.hhmmss.fffffff00')
@nickcox
nickcox / debug-to-file.xml
Created May 17, 2021 07:42
Redirect `Debug.WriteLine` output to a text file
<system.diagnostics>
<sharedListeners>
<add name="file"
autoFlush="true"
append="false"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
customLocation="c:\temp"
location="Custom"
logFileCreationSchedule="Daily"
baseFileName="Log"/>
@nickcox
nickcox / CleanSolution.ps1
Created May 17, 2021 07:40
Remove obj & bin directories (to a depth of four levels)
ls -Directory -Recurse -Depth 4 |? Name -In obj,bin | rm -Force -Recurse
@nickcox
nickcox / env.sh
Last active May 17, 2021 07:38
Source environment variables from a .env file
set -a && source .env && set +a