Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is "Windows Management Framework 5.0"?

38 views
Skip to first unread message

Robert Carnegie

unread,
Dec 30, 2015, 5:47:03 PM12/30/15
to
What I want to learn is:

Is "Windows Management Framework 5.0" the same thing as
"PowerShell 5.0"? Or are they different things?

The former, according to:

http://blogs.msdn.com/b/powershell/archive/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available.aspx

...isn't available...

The latter has a feature that I want to use in a particular project.

Jeff Zeitlin

unread,
Dec 30, 2015, 7:12:07 PM12/30/15
to
WMF includes PowerShell, and as near as I can tell, it's the only way to
get updates to PowerShell. The full release of WMF5 apparently had a
destructive bug in it, so was recently pulled pending correction of that
bug. There is or was a pre-release that didn't have that bug somewhere
on the MS site; I've used that to upgrade a Win7 box to PS5, and not
experienced any problems.

Robert Carnegie

unread,
Jan 12, 2016, 6:30:31 PM1/12/16
to
I forgot to say, thanks for this information.

Is <http://blogs.msdn.com/b/powershell/> a good place to watch
for news about this? At the moment, it still seems to be on hold -
I suppose because the people working on it, and probably a lot
of third-party testers, took a Christmas holiday; me, too.

To explain what I want to do, which ought to be a small and
simple thing - it's just to convert some large UTF-8 text
files to Microsoft UCS-2 or thereabouts, to import into
Microsoft SQL Server. I don't have an exact recipe for
doing this in Powershell 5, but the elements are there.

Alternatives that I might be able to use are a converter
that comes with Java or used to (maybe via UTF-32),
or what I actually did - open each file in the utility
"Notepad++" and then save in the appropriate encoding.
However, I don't entirely trust Notepad++ ... so, bright
idea, open the new files in the editor, save them again
in the previous format, and compare to the original file.
However, some of the converted files are too large to
open in Notepad++ - so?!? So, cross my fingers and hope.

Well, are there any other easy, effective ways to do this
sort of thing?

Jeff Zeitlin

unread,
Jan 12, 2016, 7:56:38 PM1/12/16
to
On Tue, 12 Jan 2016 15:30:30 -0800 (PST), Robert Carnegie
<rja.ca...@excite.com> wrote:

>I forgot to say, thanks for this information.
>
>Is <http://blogs.msdn.com/b/powershell/> a good place to watch
>for news about this? At the moment, it still seems to be on hold -
>I suppose because the people working on it, and probably a lot
>of third-party testers, took a Christmas holiday; me, too.

It doesn't seem like an unreasonable place to watch, but I wouldn't rely
solely on it. When I've wanted Powershell-related info, I've just done
some Google adhockery and picked up any references that looked good.

>To explain what I want to do, which ought to be a small and
>simple thing - it's just to convert some large UTF-8 text
>files to Microsoft UCS-2 or thereabouts, to import into
>Microsoft SQL Server. I don't have an exact recipe for
>doing this in Powershell 5, but the elements are there.

Actually, as near as I can tell, that's a one-liner. If I'm
understanding
http://stackoverflow.com/questions/19388342/why-does-powershell-file-concatenation-convert-utf8-to-utf16
correctly, what you're saying you want can be accomplished simply with

Get-Content $source-utf8-file | Out-File $dest-ucs2-file

and then importing to SQL Server from $dest-ucs2-file - and you don't
even need PS5 for it.


Robert Carnegie

unread,
Jan 13, 2016, 6:32:17 AM1/13/16
to
On Wednesday, 13 January 2016 00:56:38 UTC, Jeff Zeitlin wrote:
> >To explain what I want to do, which ought to be a small and
> >simple thing - it's just to convert some large UTF-8 text
> >files to Microsoft UCS-2 or thereabouts, to import into
> >Microsoft SQL Server. I don't have an exact recipe for
> >doing this in Powershell 5, but the elements are there.
>
> Actually, as near as I can tell, that's a one-liner. If I'm
> understanding
> http://stackoverflow.com/questions/19388342/why-does-powershell-file-concatenation-convert-utf8-to-utf16
> correctly, what you're saying you want can be accomplished simply with
>
> Get-Content $source-utf8-file | Out-File $dest-ucs2-file
>
> and then importing to SQL Server from $dest-ucs2-file - and you don't
> even need PS5 for it.

Aha. I was expecting to have to specify "encoding" explicitly
to get what I want, and that option seems to appear in PS5. So,
indeed, maybe I can do this without that.

I was referring to someone else's opposite conversion, which
I looked at around three months ago, and noted as follows:


copy the script content and run paste into powershell.
UTF8 versions of the XML files in the current directory are copied
into the converted folder


ls *.xml | %{ $f="converted\"+$_.name; gc $_ | sc -encoding utf8 $f}



gc is an alias for PowerShell operation "get-content".

Here it is used to read a text file.


sc is an alias for PowerShell operation "set-content".


get-content : https://technet.microsoft.com/en-us/library/ee176843.aspx

set-content : https://technet.microsoft.com/en-gb/library/hh849828.aspx

"The Set-Content cmdlet is a string-processing cmdlet that writes or
replaces the content in the specified item, such as a file."

Possible values of "encoding" are:

Unknown
String
Unicode (Microsoft favors "little Endian" 16-bit "Unicode")
Byte
BigEndianUnicode
UTF8
UTF7
UTF32
Ascii
Default
Oem
BigEndianUTF32

Robert Carnegie

unread,
Jan 14, 2016, 10:39:53 AM1/14/16
to
On Wednesday, 13 January 2016 11:32:17 UTC, Robert Carnegie wrote:
> On Wednesday, 13 January 2016 00:56:38 UTC, Jeff Zeitlin wrote:
> > >To explain what I want to do, which ought to be a small and
> > >simple thing - it's just to convert some large UTF-8 text
> > >files to Microsoft UCS-2 or thereabouts, to import into
> > >Microsoft SQL Server. I don't have an exact recipe for
> > >doing this in Powershell 5, but the elements are there.
> >
> > Actually, as near as I can tell, that's a one-liner. If I'm
> > understanding
> > http://stackoverflow.com/questions/19388342/why-does-powershell-file-concatenation-convert-utf8-to-utf16
> > correctly, what you're saying you want can be accomplished simply with
> >
> > Get-Content $source-utf8-file | Out-File $dest-ucs2-file
> >
> > and then importing to SQL Server from $dest-ucs2-file - and you don't
> > even need PS5 for it.
>
> Aha. I was expecting to have to specify "encoding" explicitly
> to get what I want, and that option seems to appear in PS5. So,
> indeed, maybe I can do this without that.

Oh - this doesn't seem to work. I think PS4 doesn't actually
understand UTF-8 (which is 7-bit ASCII until a special character
is required). What comes out is weird, but mostly just
substitutes character code XX with XX 00.

So it looks like I have to wait for PS5 (still) after all.

My test file, 2 lines, British and European currency signs:

The sign EURO represents Euro
The sign £ represents pounds.

My command line:

powershell -version 4.0 -command "&{Get-Content EuroU.txt | Out-File EuroPS4.txt}"

(Actually, something that I can drop an input file onto would
be useful, and a fixed output file name might be an advantage.)

My hex viewer:

http://en.webhex.net/

(upload file to the site, think of it as as public as Twitter)
0 new messages