Skip to content

Instantly share code, notes, and snippets.

View Tiberriver256's full-sized avatar
📚
Still learning

Micah Rairdon Tiberriver256

📚
Still learning
View GitHub Profile
@Tiberriver256
Tiberriver256 / boxstarter
Last active January 5, 2024 08:25
My personal development environment configuration
# Configure Windows
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Update-ExecutionPolicy Unrestricted
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name Get-ChildItemColor,posh-git,terminal-icons -Force
## Git
winget install -e --accept-source-agreements --silent --accept-package-agreements --id Git.Git
function Show-HTML ([string]$HTML)
{
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework')
[xml]$XAML = @'
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="PowerShell HTML GUI" WindowStartupLocation="CenterScreen">
<WebBrowser Name="WebBrowser"></WebBrowser>
Function Start-PoshWebGUI ($ScriptBlock)
{
# We create a scriptblock that waits for the server to launch and then opens a web browser control
$UserWindow = {
# Wait-ServerLaunch will continually repeatedly attempt to get a response from the URL before continuing
function Wait-ServerLaunch
{
try {
@Tiberriver256
Tiberriver256 / Get-OrgChart.ps1
Created August 21, 2016 03:32
Get-OrgChart
function Get-ADdirectReports
{
PARAM ($SamAccountName)
$AllUsers = @()
$Manager = Get-Aduser -identity $SamAccountName -Properties DistinguishedName,CN,co,city,DisplayName,mail
$DirectReports = Get-ADUser -Filter {Manager -eq $Manager.DistinguishedName} -Properties manager
Function Out-JSONView {
[cmdletbinding()]
Param (
[parameter(ValueFromPipeline)]
[psobject]$InbutObject,
[int]$Depth = 2
@Tiberriver256
Tiberriver256 / PowerShellNTFSStaticFileServer.ps1
Last active January 5, 2024 08:23
This script starts a small web server listening on localhost:8080 that will impersonate the authenticated user and serve static content. This means if they do not have NTFS permissions to the file they will get an access denied or a 404 file not found if they do not have NTFS access to list contents of the directory.
function Get-DirectoryContent {
<#
.SYNOPSIS
Function to get directory content
.EXAMPLE
Get-DirectoryContent -Path "C:\" -HeaderName "poshserver.net" -RequestURL "http://poshserver.net" -SubfolderName "/"
function new-PowershellWebGUI ($HTMLRaw,$Title,$Runspace) {
[xml]$xaml = @"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="$Title" Height="500" Width="700">
<Grid>
<DockPanel>
<WebBrowser Name="WebBrowser" DockPanel.Dock="Top" Margin="30">
</WebBrowser>
@Tiberriver256
Tiberriver256 / FeatureFileSplitter.csproj
Created December 18, 2023 17:02
A simple console app for splitting SpecFlow feature files. The aim here is to support scenario level parallelization, which is not natively supported in SpecFlow.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@Tiberriver256
Tiberriver256 / setup.ps1
Last active November 15, 2023 02:18
My Ubuntu development environment setup script
#!/bin/pwsh
Install-Module -Name Get-ChildItemColor, oh-my-posh, posh-git, nvm -Force
md ~\.config\powershell
"Set-Theme -name Darkblood" | Out-File $Profile -Append
Install-NodeVersion 8
Install-NodeVersion 10
@Tiberriver256
Tiberriver256 / LicenseSKUToNameMappingHash.ps1
Last active May 10, 2023 22:04
LicenseSKUToNameMapping HashTable
$LicenseSKUToNameMapping = @{
'SHAREPOINTENTERPRISE_MIDMARKET' = 'SharePoint Online (Plan 1)'
'ESKLESSWOFFPACK_GOV' = 'Microsoft Office 365 (Plan K2) for Government'
'AAD_BASIC' = 'Azure Active Directory Basic'
'AAD_BASIC_AAD_BASIC' = 'Azure AD Basic - Azure Active Directory Basic'
'AAD_BASIC_EDU' = 'Azure Active Directory Basic for EDU'
'AAD_EDU' = 'Azure Active Directory for Education'
'AAD_PREMIUM' = 'Azure Active Directory Premium P1'
'AAD_PREMIUM_AAD_PREMIUM' = 'Azure AD Premium P1 - Azure AD Premium P1'
'AAD_PREMIUM