Skip to content

Instantly share code, notes, and snippets.

View aldrichtr's full-sized avatar

Tim Aldrich aldrichtr

View GitHub Profile
@aldrichtr
aldrichtr / StartVSCodeServer.ps1
Created February 16, 2024 00:04 — forked from JustinGrote/StartVSCodeServer.ps1
Powershell Bootstrap script for VSCode Server
#require -version 5.1
#Usage: iwr https://tinyurl.com/VSCodeServer | iex
#Parameterized usage: & ([ScriptBlock]::Create((iwr https://tinyurl.com/VSCodeServer))) -Your -Options
param(
#Path to install the vscode binary to. This defaults to a folder in your Local AppData path. Must be writable by your current user without sudo
[string]$InstallPath,
#Installation architecture. This is normally autodetected.
$Arch,
#Installation platform. Normally autodetected.
$Target = 'unknown-linux-gnu',
@aldrichtr
aldrichtr / bash-colors.md
Created February 15, 2024 16:54 — forked from Prakasaka/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@aldrichtr
aldrichtr / github.bash
Created December 22, 2023 23:55 — forked from igrigorik/github.bash
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@aldrichtr
aldrichtr / OneNote-to-MD.md
Created November 4, 2023 11:46 — forked from heardk/OneNote-to-MD.md
Convert notes from OneNote into Markdown

Converting One Note to Markdown

This is an example of how to convert notes from OneNote into Markdown to use in other, less annoying Note applications. I am using PowerShell on Windows here, but other shell/scripting environments would work as well. If you want separate .md files, you'll need to export your OneNote pages separately. Exporting a section, or a selection of pages creates a single .docx file.

  • Download and install Pandoc
  • Export each of your note pages to a .docx (Word) format using OneNote export from the File menu
  • Gather all of these .docx files into a directory
  • Open directory in File Explorer
  • Open Powershell from the File Explorer using File -> Open Windows Powersell
  • Run the following command:
Install-Module @('PSWinDocumentation', 'PSWinDocumentation.AD', 'PSWriteWord', 'PSWriteExcel')
Import-Module PSWinDocumentation
Import-Module PSWinDocumentation.AD
# Import-Module DbaTools # (if you require SQL export)
# Those should automatically load
#Import-Module PSWriteWord
#Import-Module PSWriteExcel
#Import-Module ActiveDirectory
$Document = [ordered]@{
Configuration = [ordered] @{
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Install-Module Posh365 -force
Install-Module GPOZaurr -force
Install-Module Posh365 -force
Import-Module Posh365 -force
Import-Module GPOZaurr -force
Import-Module Posh365 -force
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Install-Module @('PSWinDocumentation', 'PSWinDocumentation.AD', 'PSWriteWord', 'PSWriteExcel') -force
Import-Module PSWinDocumentation -force
Import-Module ActiveDirectory -force
Import-Module PSWinDocumentation.AD -Force
Import-Module PSWriteWord -Force
if ($null -eq $ADForest) {
$ADForest = Get-WinADForestInformation -Verbose -DontRemoveEmpty
}
@aldrichtr
aldrichtr / Set-StandardMember.ps1
Created October 18, 2023 14:50 — forked from kevinblumenfeld/Set-StandardMember.ps1
sets PSStandardMember for all input objects
using namespace System.Management.Automation
function Set-StandardMember {
[CmdletBinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[object] $InputObject,
[parameter(Mandatory)]
[string[]] $DefaultProperties
version: 1
schemas:
- id: pro
desc: project
parent: root
namespace: true
template:
id: pro.template
type: note
children:
version: 1
schemas:
- id: pro
desc: project
parent: root
namespace: true
template:
id: pro.template
type: note
children: