
What application a file works with isn't exactly metadata ... that's
what we use extensions for on Windows, after all ;) But of course, most
apps do what PowerShell has decided (belatedly) to do: open old files in
the new version fine (or convert them), and cause the old apps to throw
errors when you open a file for the new version.
IMO, the problem with that in a shell is that you can't use it to alter
the command-line completion.
So, if you have a "script.ps1" file in a folder which is in your
$ENV:PATH ... PowerShell 1 will execute it when you type "script" in the
console. But it wouldn't do that if the file was named script.ps2 ...
and of course, a PowerShell 2 could look for ps2 AND ps1, but prefer ps2
the same as it prefers .ps1 to .exe.
So, if you use metadata instead of file extensions as a way to control
compatability, then two things happen (which are bad, in my opinion):
1) You have no way to have a v1 and a v2 version of a command which you
can put in a folder on your USB thumbdrive and add to the PATH whever
you go ... except to have something like "script.ps1" that calls either
you have any reason to have to ocassionally work on v1, you're going to
be tempted to keep all your scripts at v1.
2) Version 1 has to (attempt to) parse/execute v2 scripts to discover
they won't work, and thus show errors, instead of just ignoring them.
*shrug*
None of it is a big deal, one way or the other ... but for the scenarios
that I can think of, the extension seems better.
--
Joel