This file contains hidden or 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
using namespace System.Collections.Generic; | |
$sortedWords = @("aback", "abase", "abate", "abbey", "abbot", "abhor", "abide", "abled", "abode", "abort", "about", "above", "abuse", "abyss", "acorn", "acrid", "actor", "acute", "adage", "adapt", "adept", "admin", "admit", "adobe", "adopt", "adore", "adorn", "adult", "affix", "afire", "afoot", "afoul", "after", "again", "agape", "agate", "agent", "agile", "aging", "aglow", "agony", "agora", "agree", "ahead", "aider", "aisle", "alarm", "album", "alert", "algae", "alibi", "alien", "align", "alike", "alive", "allay", "alley", "allot", "allow", "alloy", "aloft", "alone", "along", "aloof", "aloud", "alpha", "altar", "alter", "amass", "amaze", "amber", "amble", "amend", "amiss", "amity", "among", "ample", "amply", "amuse", "angel", "anger", "angle", "angry", "angst", "anime", "ankle", "annex", "annoy", "annul", "anode", "antic", "anvil", "aorta", "apart", "aphid", "aping", "apnea", "apple", "apply", "apron", "aptly", "arbor", "ardor", "arena", "argue", "arise", "armor", |
This file contains hidden or 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-DeviceLocation | |
{ | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $false)] | |
[TimeSpan] | |
$TimeOut = [timespan]::FromSeconds(5), | |
# The accuracy of the reported location. Default relies on Network location (but can still be quite accurate). "High" requires GPS or similar to produce results | |
[Parameter(Mandatory = $false)] |
This file contains hidden or 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-InterfaceTree | |
{ | |
<# | |
.SYNOPSIS | |
Displays a tree of interfaces for a given type | |
.DESCRIPTION | |
Recursively runs the "GetInterfaces() method on a type and its interfaces to build a picture of all the interfaces that are applied to a type" | |
.EXAMPLE | |
PS C:\> Get-InterfaceTree hashtable | |
This file contains hidden or 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
# Add required types for below functions | |
Add-Type -AssemblyName System.Web | Out-Null | |
Try | |
{ | |
# Define [RequiredChars] enum type | |
Add-Type -Language CSharp -TypeDefinition @" | |
[System.Flags] | |
public enum RequiredChars |
This file contains hidden or 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 | |
Gets NTBiosName for a given domain | |
.DESCRIPTION | |
Uses .Net framework and COM objects only. No reliance on AD Cmdlets | |
Adapted from 'http://rlmueller.net/NameTranslateFAQ.htm#Powershell%20example' by Richard L. Mueller | |
Adapted by David Johnson https://gist.github.com/Cirzen | |
.PARAMETER Domain | |
Text string to use as the search criterion | |
.PARAMETER Credential |
This file contains hidden or 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 | |
Get simple Bios and OS info | |
.DESCRIPTION | |
Queries Win32_BIOS and Win32_Operating system over WsMan (default) or DCom protols to obtain Bios Serial, Service Pack Version and OSVersion info | |
.EXAMPLE | |
PS> Get-CorpSysInfo -ComputerName win81 -Protocol dcom | |
BIOSSerial ComputerName SPVersion OSVersion |
This file contains hidden or 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
#Find Wordinian words. See www.wordinian.com | |
#E.g. Stage: Stag, age, ta, a | |
$wordlist = Get-Content C:\Users\DJ\Downloads\TWL06.txt #Downloaded scrabble dictionary | |
$Searchwordlength = 12 | |
Function Test-Word ($word, $wordlist) { | |
Return $wordlist -match $word -as [bool] | |
} |
This file contains hidden or 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-ArrayProduct { | |
<# | |
.SYNOPSIS | |
Returns the multiplication product of two equally sized numerical arrays. | |
e.g (1,2,3) * (4,5,6) causes (1*4,2*5,3*6) and returns (4,10,18) | |
#> | |
[CmdLetBinding()] | |
Param( |