Skip to content

Instantly share code, notes, and snippets.

View moisei's full-sized avatar
🎯
Focusing

Moisei Rabinovich moisei

🎯
Focusing
View GitHub Profile
foreach ($group in $groups) { Write-Host " === $group == "; (Get-Culture).TextInfo.ToTitleCase((Get-ADGroupMember $group | Sort-Object -property Name | Select Name -ExpandProperty Name | Out-String -Width 100).ToLower()) }
@moisei
moisei / error-handler.sh
Last active July 24, 2022 10:12
bash stacktrace
# Bash error handler.
# On any error print full stack trace of the failure and exit with the original error code
# set -o errtrace
# inspired by https://gist.github.com/ahendrix/7030300
set -Eeuo pipefail
function errexit() {
local err=$?
set +o xtrace
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}." >&2