Skip to content

Instantly share code, notes, and snippets.

View flcdrg's full-sized avatar

David Gardiner flcdrg

View GitHub Profile
@flcdrg
flcdrg / boxstarter-bare-v3.ps1
Last active March 25, 2024 01:47
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 25, 2024 07:29
PowerShell Profile
# No profile for VS Code
if (Test-Path env:TERM_PROGRAM) {
return
}
# .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'
$vsInstanceId = "02218237"
@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 December 16, 2023 23:26
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.
  • 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
  • Run the PowerShell code to remove comments from scripts
@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 January 3, 2023 03:59
Windows Terminal
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@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.ps1
Last active March 25, 2024 01:44
Post install
# PowerShell modules. Run this from elevated PowerShell 7
# Remove preinstalled Pester
$module = "C:\Program Files\WindowsPowerShell\Modules\Pester"
takeown /F $module /A /R
icacls $module /reset
icacls $module /grant "*S-1-5-32-544:F" /inheritance:d /T
Remove-Item -Path $module -Recurse -Force -Confirm:$false
# Modules
@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