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. :-)
referenced by