Skip to content

Instantly share code, notes, and snippets.

View flcdrg's full-sized avatar

David Gardiner flcdrg

View GitHub Profile
@flcdrg
flcdrg / 1-boxstarter-bare-v4.ps1
Last active April 13, 2025 00:01
My BoxStarter Scripts
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
@flcdrg
flcdrg / FreshBing.ps1
Created April 11, 2016 02:45
Updated version of https://github.com/ndabas/FreshBing with image description
# FreshBing
# https://github.com/ndabas/FreshBing
#
# Copyright 2012-2013 Nikhil Dabas
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@flcdrg
flcdrg / profile.ps1
Last active February 2, 2025 02:14
PowerShell Profile
if ($PSVersionTable.PSEdition -eq "Core") {
$vsshell = Start-ThreadJob {
# .NET build
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
# Set this to the value returned by 'vswhere -property instanceId'
#$vsInstanceId2019 = "73b5fa7b"
if ($env:ComputerName -eq "DELPHINIUM") {
@flcdrg
flcdrg / Create-Groups.ps1
Created October 12, 2017 22:45
TeamCity
$data = @{
"GROUP_KEY" = "Group Description"
}
$user = "xxxxxx"
$password = "xxxxxx"
$pair = "$($user):$($password)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
@flcdrg
flcdrg / moderation.md
Last active March 22, 2025 11:03
Chocolatey Moderation

Please resolve these to allow this package to be approved:

  • tools\VERIFICATION.txt should contain instructions on how the user can independently verify that the embedded file is the same as available for download from the original site.
  • tools\LICENSE.txt should contain the text of the software license. This must also permit redistribution for the software to be embedded in the package.
  • Remove tools\chocolateybeforemodify.ps1 as it isn't being used
  • Remove tools\LICENSE.txt and tools\VERIFICATION.txt as they are only required when embedding files in the package
  • If you are the software author, please confirm that via a comment here. Alternatively, if you are not the software author, put your own name in the owners field.
  • Remove the file ReadMe.md
  • Remove the file update.ps1
  • Add minimum version numbers for package dependencies
@flcdrg
flcdrg / CreateVSTSItems.ps1
Created June 22, 2018 06:28
Migrate Redmine issues to Visual Studio Team Services work items
param(
$user, # "VSTS username - doesn't need @domain suffix"
$token, # VSTS personal access token
$project, # the VSTS project to create items in
$vstsAccountName, # the bit before .visualstudio.com
$csvFile, # path to the .csv file
$redmineIssueUrl # URL to legacy redmine server. eg. https://redmine/issues
)
$ErrorActionPreference = "Stop"
@flcdrg
flcdrg / settings.json
Last active April 9, 2025 02:34
Windows Terminal settings - in $Env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [],
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"keybindings":
[
{
@flcdrg
flcdrg / ohmyposh.json
Last active August 11, 2022 00:30
Oh My Posh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#fa3b3b",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
@flcdrg
flcdrg / post-install-nonadmin.ps1
Last active April 11, 2025 01:58
Post install
# Things to install/run as the signed-in user, but not elevated
# Install Azure Artifacts credential provider
iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
# NuGet global package cache - https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders?WT.mc_id=DOP-MVP-5001655
[Environment]::SetEnvironmentVariable("NUGET_PACKAGES", "d:\packages", [System.EnvironmentVariableTarget]::User)
# Create Firefox profile (so we can then set prefs)
& 'C:\Program Files\Mozilla Firefox\firefox.exe' --headless --screenshot nul
@flcdrg
flcdrg / git-configuration.sh
Last active April 26, 2023 11:22
Git config (including WSL2)
git config --global core.editor "code --wait"
git config --global fetch.prune true
git config --global push.autoSetupRemote true
# Beyond Compare
git config --global diff.tool bc
git config --global difftool.bc.path /mnt/c/Program\ Files/Beyond\ Compare\ 4/BComp.exe
git config --global merge.tool bc
git config --global mergetool.bc.path /mnt/c/Program\ Files/Beyond\ Compare\ 4/BComp.exe