Configuring the ISE

I tend to flatten my laptop about once a season. Among the other things I lose is my PowerShell_ISE customizations. They’re not many, but I miss them when I have to live without them. Fortunately, they’re all captured in my Microsoft.PowerShellISE_profile.ps1: #$PSModuleAutoLoadingPreference = ‘None’; @(     "C:\Users\timdunn\Config\PSHModules\ISESteroidsV1\ISESteroids.psd1",     "C:\Users\timdunn\Config\PSHModules\PSReadLine\PSReadline.psd1" ) | %{     if (Test-Path…

0

Left-Padding a String

I’ll be honest; .NET has more methods and classes and properties than I can shake an idiom at. In my previous blog post, I needed to left-pad a string with zeroes in order to treat it as a 32-bit binary value to [Array]::Reverse(). I also had to do the same for an 8-bit value, but…

5

Pass the CIDR, Will You?

Classless Inter-Domain Routing (e.g. 192.168.1.0/24) replaces dotted-notation netmasks (e.g. 192.168.1.0 with a subnet mask of 255.255.255.0) to do the same thing: what IP addresses are considered on-subnet (and therefore do not need to go through the default gateway) and which ones are not. In fact, both examples above are giving the same IPv4 address range,…

0

One-Liner: Left-Padding a String with Zeroes

Yesterday’s post had a little bit of sleight-of-hand involved.  For the IPv4 address to UInt64 conversion to work, each octet had to be converted into an 8-character string of ones and zeroes.  However, [convert]::ToString($int, 2) doesn’t zero pad, and this is now a string, not an Int, so I can’t use .Net’s ToString() formatting line…

0

IPv4 Addresses and CIDR Fun

Classless Inter-Domain Routing is the current way to define a subnet.  An example entry would be “192.168.1.0/24”.  What this means is that the first 24 bits of the 32 bit IPv4 address are considered ‘off the subnet.’  The last octet is considered part of the subnet.  I.e. the computer will not route traffic through the…

0

PowerShell ISE Environment Keyboard Shortcuts, Part 2

A coworker asked how many of these shortcuts I knew.  Given that I had to go looking for a shortcut that was explicitly displayed in the Edit menu, I guess you know the answer.  Then, he said he wished he could learn them.  That gave me an idea… Oh, and to save you the trouble,…

2

PowerShell ISE Environment Keyboard Shortcuts

It started with a simple question: is there a shortcut to go to the Console Pane in the ISE?  A few web pages gave lists of shortcuts, but then this guy went the extra … parsec. http://www.powershellmagazine.com/2013/01/29/the-complete-list-of-powershell-ise-3-0-keyboard-shortcuts/ TL;DR: He scraped Microsoft.PowerShell.GPowerShell DLL for strings.  That left him with a [hashtable] of name/value pairs.  I wanted…

0