Skip to content

Instantly share code, notes, and snippets.

View aldrichtr's full-sized avatar

Tim Aldrich aldrichtr

View GitHub Profile
[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:
@aldrichtr
aldrichtr / multi-workspace.md
Created October 11, 2023 23:25 — forked from kevinslin/multi-workspace.md
mutli-workspace-setup

Creating a Personal and Work specific workspace

  1. Create a personal workspace using Initialize Workspace
    • initialize with a blank vault
      • if you want to version control the vault, run Vault Convert to add a git repository to this vault
    • repeat this process with other vaults as needed (we recommend just starting off with a single vault), see reasons for going multi-vault here
    • add your workspace to version control by running the following:
      1. Initialize a git repo
@aldrichtr
aldrichtr / .gitconfig
Created September 28, 2023 17:37 — forked from rocketraman/.gitconfig
.gitconfig aliases useful for gitworkflow (https://github.com/rocketraman/gitworkflow)
[alias]
# Basically `log --oneline --decorate --graph` with different colors and some additional info (author and date)
lg = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ar)%C(reset) %C(dim black)%d%C(reset)'
# lg (see above) with --first-parent
lgp = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ar)%C(reset) %C(dim black)%d%C(reset)' --first-parent
# https://stackoverflow.com/questions/61510067/show-specific-commits-in-git-log-in-context-of-other-commits
hl = "!f() { cd -- ${GIT_PREFIX:-.}; grep --color -E \"$(git log --pretty=%h \"$@\" | tr '\n' '|')\" || true; }; f"
hlp = "!f() { cd -- ${GIT_PREFIX:-.}; less -R -p $(git log --pretty=%h \"$@\" | tr '\n' '|'); }; f"
@aldrichtr
aldrichtr / Manage-ADComputers.ps1
Created September 22, 2023 17:49 — forked from 9to5IT/Manage-ADComputers.ps1
PowerShell: Cleanup inactive AD computer objects
Import-Module ActiveDirectory
# Set the number of days since last logon
$DaysInactive = 90
$InactiveDate = (Get-Date).Adddays(-($DaysInactive))
#-------------------------------
# FIND INACTIVE COMPUTERS
#-------------------------------
# Below are three options to find inactive computers. Select the one that is most appropriate for your requirements:
@aldrichtr
aldrichtr / github-actions-notes.md
Created September 13, 2023 08:14 — forked from br3ndonland/github-actions-notes.md
Getting the Gist of GitHub Actions
@aldrichtr
aldrichtr / Matchinfo.Format.ps1xml
Created September 2, 2023 11:34 — forked from mdgrs-mei/Matchinfo.Format.ps1xml
Format file to add links to Select-String outputs
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<ViewDefinitions>
<View>
<Name>MatchInfo</Name>
<ViewSelectedBy>
<TypeName>Microsoft.PowerShell.Commands.MatchInfo</TypeName>
</ViewSelectedBy>
<CustomControl>
<CustomEntries>
@aldrichtr
aldrichtr / MoonSpinner.ps1
Created September 2, 2023 11:33 — forked from mdgrs-mei/MoonSpinner.ps1
Show a moon spinner on the tab title using DynamicTitle PowerShell module
#Requires -Modules DynamicTitle
$commandStartJob = Start-DTJobCommandPreExecutionCallback -ScriptBlock {
param($command)
(Get-Date), $command
}
$promptJob = Start-DTJobPromptCallback -ScriptBlock {
(Get-Date)
}