PowerShell ISE will do *everything* (though some assembly may be required!)

by Michael S. Kaplan, published on 2013/02/19 07:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2013/02/19/10395086.aspx


A timely follow-up to PowerShell ISE (or legacy) will do *everything* (and it's really easy to start!) and PowerShell ISE will do *everything* (IF YOU LET IT!)....

After all, in that first blog I talked about Internationalization.

And World-Readiness.

But all I really went on about was the ISE (Integrated Scripting Environment), and how easy it was to get to, no matter how hard Windows 8 might try to make it.

So where's the Internationalization?

Where's the World-Readiness?

Well, there is one great thing the ISE brings to the min.

The .NET Framework!

And its namespaces, like System.Globalization and System.Globalization.DateTimeFormatInfo and System.Globalization.NumberformatInfo.

All you have to do is add a CurrentCulture or a CurrentUICulture, and stir!

Of course, it is important to either

So first you have to find out if the environment is set up properly when your cmdlet is called.

If it is not set up properly, then you will have to figure out how to set it up....

I suppose you will have to answer that, based on your cmdlet's scenario!

For example do you need your user interface to be localized?

Just set the CurrentUICulture.

And vdo you need to format dates and times and number and currency values?

Just set the CurrentCulture.

Do you need to sort lists of items?

Again, just set the CurrentCulture.

Easy!

Do you need the two settings to be the same?

Even easier! Just set CurrentCulture = CurrentUICulture!

And is your cmdlet a lower level workhorse that relies oin higher level cmdlets to do the heavy lifttng?

That's easiest! Just don't set a bleeding thing, and let the bloody higher level protocols that have all the bleeding answers provide all the bloody answers.

They wanted to, anyway. :-)


no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2013/02/20 PowerShell ISE will do *everything* (but good luck finding it on Windows 8 without help!)

go to newer or older post, or back to index or month or day