Skip to content

Instantly share code, notes, and snippets.

@sean-m
Last active October 5, 2020 23:21
Show Gist options
  • Save sean-m/13e0977164cc38d314cc0b80eda776e9 to your computer and use it in GitHub Desktop.
Save sean-m/13e0977164cc38d314cc0b80eda776e9 to your computer and use it in GitHub Desktop.
It gets old trying to do these by hand all the time, pipe to clip.exe and call it a day.
## Generate comment blocks that can denote regions in your script
filter HeaderComment {
[Alias('HC')]
param(
[Parameter(Position=0, ValueFromRemainingArguments)]
$msg
)
$msg = $msg -join ' '
@"
################################################################################
$($msg.PadLeft((76/2) + ([Math]::Ceiling($msg.Length/2))).PadRight(76).PadLeft(78,'#').PadRight(80,'#'))
################################################################################
"@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment