Except for the "iex" this isn't really Powershell specific - it's just instantiating a .NET framework object and calling a method on it. It might as well be C#.
And yeah I realize you can come up with an ugly command line example in just about anything. But powershell tends to be one of the uglier ones out there.