This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Creates test text-based files with various character encodings. | |
.DESCRIPTION | |
Creates text-based test files using | |
* all 5 byte order-marked Unicode character encoding schemes, | |
both with and without BOM (Unicode signature) | |
* default encodings, | |
with the the platform's default encoding, [System.Text.Encoding]::Default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-DotNetCoreVersion { | |
<# | |
.SYNOPSIS | |
Gets version information about a .NET Core installation or project. | |
.DESCRIPTION | |
Gets version information about the globally installed .NET Core components | |
or a specific project. | |
Note: Requires PSv6+, due to use of type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Prerequisites: PowerShell version 3 or above. | |
License: MIT | |
Author: Michael Klement <mklement0@gmail.com> | |
DOWNLOAD and DEFINITION OF THE FUNCTION: | |
irm https://gist.github.com/mklement0/8689b9b5123a9ba11df7214f82a673be/raw/Out-FileUtf8NoBom.ps1 | iex | |
The above directly defines the function below in your session and offers guidance for making it available in future |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Prerequisites: PowerShell v3+ | |
License: MIT | |
Author: Michael Klement <mklement0@gmail.com> | |
DOWNLOAD and INSTANT DEFINITION OF THE FUNCTION: | |
irm https://gist.github.com/mklement0/356acffc2521fdd338ef9d6daf41ef07/raw/Select-StringAll.ps1 | iex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# fanout utility - send stdin input to multiple target commands. | |
# | |
# Copyright (c) 2017 Michael Klement, released under the [MIT license](http://opensource.org/licenses/MIT). | |
# | |
# Aside from requiring Bash 3+, this utility should be portable: | |
# It uses only POSIX-compliant utilities with POSIX-compliant options. | |
# | |
# Invoke with --help for help. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setLocal enableDelayedExpansion | |
:: === ADAPTING THIS TEMPLATE (for help, see bottom or invoke with "help") === | |
:: * Step 1 of 3: CLONE THIS BATCH FILE and give it a name of your choice. | |
:: * Step 2 of 3: Set the TARGET LANGUAGE on the next line. | |
:: One of: "ps1" "vbs" "js" (PowerShell, VBScript, JScript) | |
:: OR: "all" (runs ALL embedded snippets, in sequence) | |
:: NOTE: To add support for a new language, search for "NEW LANGUAGE" | |
:: below and follow the instructions there. | |
set "WRAPPER_LANG=ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Prerequisites: Windows PowerShell 5.1, PowerShell (Core) (v6+) - MAY work in earlier versions | |
License: MIT | |
Author: Michael Klement <mklement0@gmail.com> | |
DOWNLOAD and INSTANT DEFINITION OF THE FUNCTION: | |
irm https://gist.github.com/mklement0/83e8e6a2b39ecec7b0a14a8e631769ce/raw/Test-WinCredential.ps1 | iex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Prerequisites: PowerShell v5.1 and above (verified; may also work in earlier versions) | |
License: MIT | |
Author: Michael Klement <mklement0@gmail.com> | |
DOWNLOAD and DEFINITION OF THE FUNCTION: | |
irm https://gist.github.com/mklement0/9e1f13978620b09ab2d15da5535d1b27/raw/Time-Command.ps1 | iex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-MinPsVersionForCmdlet { | |
<# | |
.SYNOPSIS | |
Determines the minimum PowerShell version required for a given standard cmdlet. | |
.DESCRIPTION | |
NOTE: | |
* v3 or higher is required to run this function. | |
* Only cmdlets with help topics defined in the GitHub | |
PowerShell-documentation repository at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-OpenFiles { | |
<# | |
.SYNOPSIS | |
Finds open files. | |
.DESCRIPTION | |
Finds files currently being held open by any process and reports them as | |
[System.IO.FileInfo] instances, as Get-ChildItem would. | |
In fact, this function supports all parameters that Get-ChildItem does and |
OlderNewer