Skip to content

Instantly share code, notes, and snippets.

Anthony Gutierrez AntGut

Block or report user

Report or block AntGut

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AntGut
AntGut / Indent-String.ps1
Created Oct 3, 2018
Indents/PadLeft an InputString a specified amount (using specified char) and PadRight (with a specified char) if necessary to make output string the specified total length.
View Indent-String.ps1
<#
.SYNOPSIS
Indents/PadLeft an InputString a specified amount (using specified char) and PadRight (with a specified char) if necessary to make output string the specified total length.
.DESCRIPTION
-- All PadLeft/PadRight constraints are adhered to.
-- By default if "IndentCount + InputString.Length() > TotalLength", Indent/PadLeft will take precedence [return string will be longer than TotalLength].
This behavior can be overridden using "UseTotalLength".
-- Default padding character is a <space> which can be overridden.
@AntGut
AntGut / Pad-String.ps1
Last active Oct 2, 2018
Pads an input string with spaces.
View Pad-String.ps1
#--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==
function Pad-String ($InputString, $LeftPadding = 0, $RightPadding = 0) {
#--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==
<#
.SYNOPSIS
LeftPads input string by the specified amount and RightPads if necessary to make output string the specified total length.
.DESCRIPTION
All LeftPad/RightPad constraints are adhered to.
#>
@AntGut
AntGut / Get-ServiceLogOnAs.ps1
Last active Sep 27, 2018
Get information about the services on the local Microsoft Windows machine with focus on the "Log on as" account details.
View Get-ServiceLogOnAs.ps1
<#
.SYNOPSIS
Get information about the services on the local Microsoft Windows machine with focus on the "Log on as" account details.
.PARAMETER Filtered
Services are filtered to those not using "built-in" accounts.
Basically ignore services where "Log on as" is "LocalSystem", "NTAuthority\NetorkService" and similar.
.PARAMETER Export
Service information is exported to CSV.
You can’t perform that action at this time.