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: Filtering Show-NetIPSec Rules based on IP Address

    Get-NetIPSecRule seems a little half-baked.  A coworker asked me to come up with a way to only return IPsec rules for a given address.  I’m surprised Show-NetIPSecRule natively doesn’t have that, nor does each record have the RemoteAddress property, which would be against which I would filter...
  • 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: Getting Version Data From Comment Based Help

    Disclaimer: There’s a lot of parse-by-prayer here. You Have Been Warned. Here’s the short form: I try to keep a change log of sorts in the comment-based help for my scripts. (I say try because that’s sadly the first thing to be omitted when I’m in a hurry. Code clarity is sadly...
  • Blog Post: Abbreviated Key Names in Synthetic Properties

    The title is almost longer than the post. From Chris Dent's http://www.indented.co.uk/index.php/2010/01/12/powershell-iis-and-log-settings/ , I see that he's generating synthetic properties with Select-Object -Property @{n = 'name'; e = { "this row's name" } } Notice anything? PSH allows the...
Page 1 of 1 (4 items)