Last month I started playing with WPF to show how a multi-coloured clock could be displayed on screen. This was picked up and an easier version was created by Doug Finke using the ShowUI module from codeplex http://showui.codeplex.com/ . Other...
Following on my post about using enums http://msmvps.com/blogs/richardsiddaway/archive/2011/08/02/enums.aspx I thought it might be fun to see how we can make our own. If we look at Win32_LogicalDisk PS > Get-WmiObject Win32_LogicalDisk | ft DeviceID...
No not something added to your food but .NET enumerations. These are collections of defined values such as the default folder names that we have seen in Outlook. An enumeration (to use the full name) looks a bit like a .NET class and we access it in a...
In answer to a forum question I started to look at how you could move the PowerShell window from within PowerShell. Its not straight forward as we have to dig into the Win32 APIs I came up with this code function move-window { param ( [int] $newX , [int...
I don’t do much with Windows forms as the vast majority of what I do is at the admin end of the PowerShell spectrum. Every now and then I like to play. A recent post on the forum asking about displaying a clock from PowerShell looked like a good excuse...
In yesterday’s blog post , I wrote about being able to use later versions of the .NET Framework with PowerShell. The trick was simple: create a config file, a small file of XML, to enable the use of, in my case, the .NET Framework Version 4 and the new...
I’ve been playing around a bit with the latest version of the .NET Framework. There are some pretty cool new classes and namespaces but one that caught my eye was System.Numerics. This namespace has two neat classes: System.Numerics.BigInteger and Sytem...
< # .SYNOPSIS This script creates and starts a Process using .NET .DESCRIPTION This script Creates a process object and sets the executable to notepad. The script then starts the process...
On one of our internal discussion aliases, someone asked why do we need a plus (+) the class name for FTP? Typically, you would expect this to work [Net.WebRequestMethods.Ftp], but it doesn’t. The solution is [Net.WebRequestMethods+Ftp] and it has something to do with nested classes In C#, a nested class...
Over on Hal Rotettenberg’s blog ( TechProsaic ), he recently posted an interesting article about how to tell if an object in PowerShell is an array or a scalar. His solution was to use the Get-Type method, and to look for the BaseType property of the...
This week, Jeffrey Snover has posted an excellent post, Explore Your [Environment] , that examines both some of the details of the [System.Environment] class but also on how PowerShell integrates with .NET. As I said in a comment on the blog, I wish I...