Code

I haven't done as much as I would like, but there are a few minor contributions to the free software / open-source community out there that I've made over the years. The largest (by far) is the property management software I'm continuing to develop, HOAM, and it receives regular updates.

Unfortunately, while I know more is out there, it has been lost to the ages (or my lack of Google-fu) and while Archive.org may have copies of some text they don't have the compressed archives.

Snippets

A few small useful code snippets in Powershell

Determine whether a computer is a desktop or laptop
I found that the easiest way that works 99% of the time is to simply check for the presence of a battery.
$charge = Get-WMIObject Win32_Battery -property EstimatedChargeRemaining
if (($charge.EstimatedChargeRemaining -ne '') -and ($charge.EstimatedChargeRemaining -gt 0)) {
  write-host 'battery present'
  $charge.EstimatedChargeRemaining
} else {
  write-host 'battery not present'
}
List all computers in an OU
$austin = [asdi] "LDAP://localhost:389/ou=Austin,dc=example,dc=com"
$searcher = New-Object System.DirectoryServices.DirectorySearcher $austin
$searcher.Filter = '(objectClass=Computer)'
$searcher.FindOne()

$searcher | Format-List *
Get the next available drive letter
function GetNextAvailableDriveLetter () {
  // Check the machine for available drive letters.
  $current_drives = Get-WmiObject -query "Select * from Win32_LogicalDisk"
  $drive_list = @()
  foreach ($drive in $current_drives) {
    $drive_list += $drive.DeviceID
  }

  for ($i = 67; $i -le 90; $i++) {
    $strDrive = Chr(i) + ":"
    If ($drive_list -contains $strDrive) {
    } else {
        return $strDrive
    }
  return FALSE
}