Skip to content

Fix #99: 'using module' relative path resolution #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2016

Conversation

daviwil
Copy link
Contributor

@daviwil daviwil commented Mar 8, 2016

This change fixes an issue with relative module path resolution with the
'using module' statement in more recent versions of PowerShell v5. A new
method overload was added to the PowerShell API's Parser.ParseInput method
which allows the script's path to be specified. By using this parameter,
the PowerShell parser resolves relative module paths correctly.

This change also required a change to how PowerShell API usage is verified
for different PowerShell versions. Since the PowerShell v5 reference
assemblies don't (yet) contain Parser.ParseInput overload, we now have to
make a distinction between the PowerShell v5 which is specified by the
reference assemblies and the one that is currently shipped in the latest
official Windows 10 release (10586). Once updated reference assemblies
have been shipped for PowerShell v5 we may revisit this approach.

daviwil added 2 commits March 8, 2016 11:57
This change fixes an issue with relative module path resolution with the
'using module' statement in more recent versions of PowerShell v5.  A new
method overload was added to the PowerShell API's Parser.ParseInput method
which allows the script's path to be specified.  By using this parameter,
the PowerShell parser resolves relative module paths correctly.

This change also required a change to how PowerShell API usage is verified
for different PowerShell versions.  Since the PowerShell v5 reference
assemblies don't (yet) contain Parser.ParseInput overload, we now have to
make a distinction between the PowerShell v5 which is specified by the
reference assemblies and the one that is currently shipped in the latest
official Windows 10 release (10586).  Once updated reference assemblies
have been shipped for PowerShell v5 we may revisit this approach.
This change updates appveyor.yml to use the new AppVeyor image that
includes WMF 5.0 RTM.  This is needed for a small API change that
intruduced after WMF 5.0 Production Preview.
@daviwil
Copy link
Contributor Author

daviwil commented Mar 8, 2016

I'm going to verify that this works against a Windows 10 RTM machine before I merge it.

@daviwil
Copy link
Contributor Author

daviwil commented Mar 8, 2016

Seems to be working fine on Win 10 RTM with PowerShell 5.0.10240.16410

daviwil added a commit that referenced this pull request Mar 8, 2016
Fix #99: 'using module' relative path resolution
@daviwil daviwil merged commit a1e6dbc into master Mar 8, 2016
@daviwil daviwil deleted the daviwil/using-module-fix branch March 26, 2016 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants