Lessons Learned

My drop-site for interesting snippets and tips. If it's useful to you as well, great!

Browse by Tags

Tagged Content List
  • Blog Post: Getting SRV Records with PowerShell

    PowerShell leverages .NET, and .NET exposes the System.Net.Dns class, so all should be happy, no?  Evidently not if it comes to SRV records.  Someone asked me how to do it, and I said, “That’s easy.  I’ll get back to you in a few.” A few hours later, I realized it wasn’t so easy. Get-NslookupSrvRecord...
  • Blog Post: #StupidProfileTrick - FunctionList

    As I previously posted, my $Profile is stupidly complicated, and it adds a ton of functions.  Which ones did I add? (Reason this is of interest to me is because I mistakenly named a function with the same name as a cmdlet.  Yeah, totally stupid move on my part.  More on that later.) #region...
  • Blog Post: Getting Disk Usage

    No time to document it.  Had to throw something together, so here it is. function Get-DiskUsage { param ( [Parameter(ValueFromPipeline=$true)][string[]]$Path = (Get-Location).Path, [string]$CsvPath = "$env:TEMP\$($MyInvocation.MyCommand.Name) $($env:Computername) $(Get-Date -Format 'yyyy...
  • Blog Post: PowerShell for Non-N00bs: [PSObject]::AddNodeProperty - the Missing Link

    We all know PSH can output objects. When the cmdlets or input give it objects to work with, outputting objects is easy. However, when the program is dealing in strings and objects are required, things get long. PS> $psobject = New-Object PSObject PS> Add-Member -MemberType NoteProperty -InputObject...
  • Blog Post: PowerShell for Non-N00bs: [PSObject]::AddNodeProperty - the Missing Link

    We all know PSH can output objects. When the cmdlets or input give it objects to work with, outputting objects is easy. However, when the program is dealing in strings and objects are required, things get long. PS> $psobject = New-Object PSObject PS> Add-Member -MemberType NoteProperty -InputObject...
Page 1 of 1 (5 items)