Define DynamicKeyword 'ExecTest'
Note: Don't copy&paste from following code. PowerShell SyntaxHighlighter remove some lines. Instead, use RAW view.
#Requires -Version 4.0
Set-StrictMode -Version Latest
using namespace System.Collections.Generic | |
function Find-CommandDelta { | |
param( | |
$ModulePath = 'C:\git\dbatools', | |
$Uri = 'C:\git\web\commands\index.html', | |
$Exclude = @('Where-DbaObject') | |
) | |
end { | |
$path = 'D:\Games\Blizzard\World of Warcraft\_classic_\Interface\AddOns\ISBoxer\ISBoxer.toc' | |
$data = Get-Content $path | |
$properties = @{} | |
$pattern = '## (?<propertyName>[^:]*): (?<propertyValue>.*)' | |
foreach($line in $data) | |
{ |
{ | |
"template": "*", | |
"order": 0, | |
"mappings": { | |
"doc": { | |
"dynamic_templates": [ | |
{ | |
"strings_as_keywords": { | |
"match_mapping_type": "string", | |
"mapping": { |
function Get-AllCaps | |
{ | |
param( | |
[char[]]$InputObject | |
) | |
If($InputObject.count -eq 1) | |
{ | |
Write-Output $InputObject[0].ToString().ToUpper() | |
Write-Output $InputObject[0].ToString().ToLower() |
http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html
function Get-Double ($number){$number + $number} | |
function Get-Double2 | |
{ | |
<# | |
.SYNOPSIS | |
.EXAMPLE | |
New-Function -ComputerName server | |
.EXAMPLE |
<# | |
.SYNOPSIS | |
Used to replace text in a file. | |
.EXAMPLE | |
Get-ChildItem -Recurse | Set-String -Pattern "c:\documents" -ReplaceWith "c:\users" | |
.EXAMPLE | |
Set-String -Pattern "c:\documents" -ReplaceWith "c:\users" -Path c:\temp\script.ps1 | |
#> | |
Function Set-String | |
{ |
function Get-ChessResult | |
{ | |
[CmdletBinding()] | |
Param( | |
[Parameter( | |
Position = 0, | |
Mandatory = $true, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true |
<# | |
.Example | |
.\HadoopVSPowershell.ps1 | |
.Author | |
@KevinMarquette | |
.Notes | |
You may need to [GC]::Collect() after this because it uses a lot of RAM | |
#> | |
[cmdletbinding()] | |
param([string]$Path = (Get-Location)) |