DVR sort by size

Jekyll Island at high tide
Jekyll Island at high tide

When I get home from a trip like yesterday’s getting home from Jekyll Island, one of the first things I do is check out the free space remaining on the DVR. At times I get it down to under 50% full, but there have been times upon returning home I was up to over 95% full. Sports events usually take up the most space, so I prioritize watching and deleting those first.

Yeah, at the moment I have 16 soccer games on it. Because some of these are tournaments which could go into overtime, the recordings are 4-5 hours in some cases with only 2 hours of content because they did not actually go into overtime.

The are two views for ordering things to watch:

  • Recent
  • Title

Those are generally good options. For 99.99% of the time, when I am looking for something, those are the best ways to find things. A view sorting them with the largest size at the top would help me prioritize my time.

I know to look for the sports stuff. But some times a sports event might affect when a show starts, so I’ll add extra time to the show just in case.

Probably not many people have this problem or care. I’d even be happy with a details view where I can scan for how long is the recording.

Detecting .NET Version

Background: We got a notice a few minutes before last week’s maintenance window that side work to configure a tool ran into a snap. Today we found out that the server intended to be used did not have the right .NET version. Why did they not just install it? Good question.

This made me curious about which of the 114 servers have which version. So I found a Stackflow post on identifying .NET version. I then wrote this Powershell wrapper script around one of the solutions. The one I picked looks at the registry keys.

# Get my list of servers
$computers = Get-Content ‘server_list.txt’

# Contact each server in the list in order before moving on to next
foreach ($computer in $computers)
{
# Remote connect to current server
Invoke-Command -computername $computer -scriptblock {
# ID host name
$remotehostname = c:\windows\system32\hostname.exe
# Find largest .NET version
$dotnet = Get-ChildItem ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP’ | sort pschildname -des | select -fi 1 -exp pschildname
# Write hostname and .NET version
Write-Host “$remotehostname == $dotnet”
}
}

The foreach loop essentially forces the Invoke-Command to do the test in order. This is slower as it contacts the remote server, does the commands, then closes the connection. Without it, servers would respond at about the same time and the output reside on the same line and out of order.

Probably there are better ways to do this, but I am just a beginner.

Also on the Stackflow page there are better approaches. Because uninstalling .NET does not remove the registry keys, this method is vulnerable to be incorrect. I guess that is a possibility.

Oh, on which have what: 22 have .NET2, 48 have .NET3.5, and 44 have .NET4. Not consistently obvious factors like version of the application, life cycle tiers, or anything obvious explain why which have what. Though, they do tend to be the same version within the same cluster of servers.