Skip to content

Instantly share code, notes, and snippets.

View MattCurryCom's full-sized avatar

Matt Curry MattCurryCom

View GitHub Profile
$targetfolder='C:\Windows'
$dataColl = @()
gci -force $targetfolder -ErrorAction SilentlyContinue | ? { $_ -is [io.directoryinfo] } | % {
$len = 0
gci -recurse -force $_.fullname -ErrorAction SilentlyContinue | % { $len += $_.length }
$filesCount = (gci -recurse -force $_.fullname -File -ErrorAction SilentlyContinue | Measure-Object).Count
$dataObject = New-Object PSObject -Property @{
Folder = $_.fullname
SizeGb = ('{0:N3}' -f ($len / 1Gb)) -as [single]
filesCount=$filesCount
@MattCurryCom
MattCurryCom / mac-linux-colors.sh
Last active July 8, 2024 17:09
Mac Color fix
#!/bin/bash
#######################
#### Author: Matt Curry
#### Date 07/08/24
#### Adds Colors to mac shell, so you can see the difference between directories/files/etc...
#######################
# or for .profile
echo " " >> ~/.profile
echo "# Mac Color Fix" >> ~/.profile
@MattCurryCom
MattCurryCom / ami-to-ova.sh
Created December 18, 2024 17:47
converts multi part ami's into ova
#!/bin/bash
# Ensure the script exits on error
set -e
# Function to check if a command exists
function command_exists() {
command -v "$1" &> /dev/null
}