Skip to content

Instantly share code, notes, and snippets.

View Chirishman's full-sized avatar
⚔️
I guess statuses are a thing now

Chirishman

⚔️
I guess statuses are a thing now
View GitHub Profile
@Chirishman
Chirishman / ConvertTo-UTF8.ps1
Created April 15, 2019 21:42
Function to convert a file on disk to UTF8-NoBOM
function ConvertTo-UTF8 {
Param(
[ValidatePathExists()]
[System.IO.FileInfo]$Path
)
[string]$Contents = (Get-Content -Path $Path) -join "`r`n"
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
@Chirishman
Chirishman / Convertto-OutlookHTMLTable.ps1
Last active March 22, 2019 20:52
Function to allow advanced table styling in HTML based emails opened in Outlook
Function Convertto-OutlookHTMLTable {
Param(
[Parameter(ParameterSetName='CSVInput')]
[string]$CSVFile,
[Parameter(ParameterSetName='CSVInput')]
[string]$Delimiter = ',',
[Parameter(ParameterSetName='InputObject')]
[object]$InputObject,
[string]$CSS,
[string]$CSSFile
<#
.SYNOPSIS
This Function is designed to RickRoll a specified target(s).
.DESCRIPTION
This Function will RickRoll a specified target(s) by doing the following:
1. Connect to the specified remote computer(s)
2. Use Get-CimInstance to return the logged on user
3. Create a file containing:
a. The RickRoll expression to be run
b. Code to remove teh script after run
@Chirishman
Chirishman / Invoke-PSHtml5.ps1
Created March 15, 2019 20:47
Found Code from LeeHolmes.com
# PowerShell + HTML5 prototype. Needs audio. Run: iex (New-Object Net.WebClient).DownloadString("http://bit.ly/e0Mw9w")
if($host.Name -ne "ConsoleHost")
{
Start-Process powershell -ArgumentList '-noprofile -noexit -command iex (New-Object Net.WebClient).DownloadString(''http://bit.ly/e0Mw9w'')'
return
}
$data = 'H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In638zpb5E36Wfp7biUpPR+lP/ZjvyeeH//xH/89f5x/0C9Dz4/rvz/2ex4+0kd+Ofz4k0/MewIC/3zyyScfH9Lz6PDwx3/s95T2I/Pio0O8Ii/5nX/Cb/ivcGN57BsGGfcKnuAVfcn1gtbyAr3ycfwVfklesQ+N4uNPOq+M+D8e/CH+k3af8JtoT80+1p+2l5G05v/jM3mBn48/jr4ywiNIDb1yqDT2X9Fh8D+fdF5BYzct/iv8EX7EXzGd4BWLlyHZx+EL/M7Hn0gX+goTzL3i3vjkYzsY/ONeca39Vyyl5SWlQu8V6evjT7Qffsdy5MeHOlp5xcMLvXzM73Dbj/kfDIbJaSkWIPboUBoyWh8zmvrKobxlGMbh9ejRJwYzxsiMwgB8pETmF/i/kTcY88rH+oq8Frwykp68mWFS8TsOcXnFodV9xcyle8N/ZSTI4ZVDeeHHzSuuE6bYj3sA7MedXjqvuF70gQx0MDv8xBLMUExe0bfwsXTz4zKX4JdPPu73gn91goCG6cYg9uM//nHwiocXXsIcB4ihHesL5jKn+
@Chirishman
Chirishman / MaintanenceDSC.psm1
Last active March 12, 2019 16:51
Class Based DSC resource for patching and rebooting during specified maintenance windows
class MaintenanceWindow {
[Bool]$Enabled = $true
[DateTime]$StartTime
[DateTime]$EndTime
[System.DayOfWeek[]]$DaysOfWeek = @([System.DayOfWeek]::Saturday, [System.DayOfWeek]::Sunday)
[ValidateSet('Weekly', 'Daily')][string]$Frequency
MaintenanceWindow ([DateTime]$StartTime, [DateTime]$EndTime, [String]$Frequency) {
$this.StartTime = $StartTime
$this.EndTime = $EndTime
  • Spirit Circle

  • Ballroom e Youkoso

  • Dungeon Meshi

  • Made in Abyss

  • R.O.D - Read or Die

  • Golden Kamui

  • Amano Megumi wa Suki Darake!

  • Monster Musume no Iru Nichijou

  • Gakkougurashi!

@Chirishman
Chirishman / Get-ForumStory.ps1
Created November 5, 2018 22:59
Prototype tool for downloading threadmarked XenForo stories
function Get-ForumStory {
[CmdletBinding()]
Param(
[Parameter(Mandatory)]
[uri[]]$StoryUri,
[Parameter(Mandatory)]
[ValidateSet('text','html')]
[string]$OutputType,
[Parameter()]
[string]$OutputFolder = 'C:\temp\'
$AllSerial = [System.IO.Ports.SerialPort]::getportnames()
$RemoveNonUSBSerial = Get-PnpDevice -FriendlyName '* (COM*' -Class 'Ports' | ?{$_.DeviceID -notmatch '^BTHENUM'}
$FriendlyNames = ($RemoveNonUSBSerial.FriendlyName) -join '|'
$USBComPorts = $AllSerial | ?{$FriendlyNames -match "\($_\)"}
function Get-UserMailboxMigrationState {
Param(
[string]$SamAccountName,
[int]$CreatedWindow
)
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$DirectoryEntry = [System.DirectoryServices.DirectoryEntry]::New()
$DirectorySearcher = [System.DirectoryServices.DirectorySearcher]::New($DirectoryEntry)
@Chirishman
Chirishman / .block
Created August 30, 2018 23:04 — forked from mbostock/.block
Radial Tidy Tree
license: gpl-3.0
border: no
height: 1060