Skip to content

Instantly share code, notes, and snippets.

View comnam90's full-sized avatar

Ben Thomas comnam90

View GitHub Profile
@comnam90
comnam90 / Get-CableLength.psm1
Last active May 31, 2023 01:51
Module for calculating length of cable required between 2 devices in a rack
$FunctionsToExport = '*'
function ConvertFrom-RackUnits {
[cmdletbinding()]
param(
[int]$RackUnits,
[switch]$Imperial
)
if ($Imperial) {
@comnam90
comnam90 / Test-S2DHealthState.ps1
Last active November 30, 2022 20:15
This is an example of a S2D Health State test to check the cluster and it's nodes are in a safe state to patch. It will return $true if everything is healthy, or $false if there is any issues to be aware of. Use the `-Verbose` switch to see more details on the cluster state.
function Test-S2DHealthState {
[cmdletbinding()]
param()
$Healthy = $true
# Check all nodes are running (not paused)
Write-Verbose "Checking Nodes are all up..."
$Nodes = Get-ClusterNode
Switch ($Nodes) {
{ $_.State -ne 'Up' } {
@comnam90
comnam90 / AU-Test-History.md
Created July 22, 2020 03:58
AU-History Test

@comnam90
comnam90 / Update-AUPackages.md
Last active May 6, 2024 23:15
Update-AUPackages Report #powershell #chocolatey
@comnam90
comnam90 / Get-S2DCacheChurn.ps1
Last active February 25, 2020 02:23
Get the average daily cache usage for a WS2019 Cluster
Function Get-S2DCacheChurn {
<#
.SYNOPSIS
Query a cluster for cache daily write stats
.DESCRIPTION
Makes use of the 'Get-StorageHistory' command and the Cluster Performance
History database to display stats for each cache drive in a cluster, such as
estimated Drive Writes per Day (DWPD), average daily writes, and average
write throughput.
@comnam90
comnam90 / Align-VMsWithStorage.ps1
Last active January 13, 2021 15:05
Updated Darryl van der Peijl's script to work with Non-S2D CSVs
<#
.DESCRIPTION
Align-VMsWithStorage is a script that can be used to align your VMs
with your Cluster Shared Volumes. With Storage Spaces Direct all writes
are routed through the owner of the CSV which can cause ineffiecient IO paths.
This script makes sure your VM is running on the same host which owns the CSV
the VM is running on.
The script finds the volume where most of your disks of your VMs are on and moves the VM there.
@comnam90
comnam90 / Export-MyIngiteToICS.ps1
Last active September 22, 2020 17:03
Export MyIgnite Schedule to ICS Files
#I2outlook.ps1
## UPDATED: 2020-09-22
## UPDATED By: Ben Thomas (@NZ_BenThomas)
### Changelog:
### - Fixed up api url
### - Added handling for pre-recorded sessions with no start time
### - Fixed up duration calculation
### - Fixed up invalid characters
### - Added session and speaker urls to event descriptions
@comnam90
comnam90 / Get-CacheDiskStatus.ps1
Created October 3, 2019 21:48
Updated Get-CacheDiskStatus command
Function Get-CacheDiskStatus
{
<#
.DESCRIPTION
Get-CacheDiskStatus is a script that can be used verify the boundings to cache devices
with Storage Spaces Direct
.INPUTS

Keybase proof

I hereby claim:

  • I am comnam90 on github.
  • I am nz_benthomas (https://keybase.io/nz_benthomas) on keybase.
  • I have a public key ASCYwHHIswAo8pe3lOqe3dlg8n-ImZis-VmcOm0oggrokQo

To claim this, I am signing this object: