Sort-DNS

This will take a list of DNS domains and sort them properly with the TLD being the most significant and the left-most subdomain being the least significant.  I reverse the order of the domain, sort the array, then reverse the order again.

Example:

Output:

 

Read More →
Windows System Idle Timer

Here’s the VB.Net class that does the API work:

  To keep the system from idling to sleep:

  To show the current system idle timer:

  This code only affects the current thread. As soon as the thread closes the system is returned to its previous state.

Read More →
Toggle-NIC.ps1

 

Read More →
Testing if a Web Page is Reachable

 

Read More →
Tame-Process Script

I wrote this to run via Task Scheduler under the SYSTEM account when the computer boots to lower the priority/affinity of CPU hungry background apps and to kill useless background processes. Every 60 seconds it checks the list of running processes, kills the ones in $killList array, then lowers the priority and affinity of the […]

Read More →
STDIO Redirection

 

Read More →
Speed Up Execution By Disabling CRL Checks

By default PowerShell checks the Certificate Revocation List for all digitally signed modules or code. This can significantly increase the time it takes to load an assembly or module. There are a few ways to do this including disabling CRL checks in Internet Explorer’s security settings. This will work but it will also disable CRL […]

Read More →
Some Raw Console Properties

 

Read More →
SendKeys in PowerShell

  Key Modifiers Key Code Shift + Ctrl ^ Alt %   Key Codes Key Code BACKSPACE {BACKSPACE}, {BS}, or {BKSP} BREAK {BREAK} CAPS LOCK {CAPSLOCK} DEL or DELETE {DELETE} or {DEL} DOWN ARROW {DOWN} END {END} ENTER {ENTER}or ~ ESC {ESC} HELP {HELP} HOME {HOME} INS or INSERT {INSERT} or {INS} LEFT ARROW […]

Read More →
Regular Expressions in PowerShell

We’ll be using this $text variable throughout this short RegEx demo:

  -Match The -Match operator will return after the first match. This returns $True if a successful match was found and $False if not. If capturing groups are used in the expression the results are stores in the special $Matches hashtable. Item 0 […]

Read More →