Giter Site home page Giter Site logo

Support for PS v2 about jump-location HOT 15 OPEN

tkellogg avatar tkellogg commented on August 10, 2024
Support for PS v2

from jump-location.

Comments (15)

lzybkr avatar lzybkr commented on August 10, 2024

So you're using PowerShell V2, right? RootModule was added in V3 I think.

from jump-location.

tkellogg avatar tkellogg commented on August 10, 2024

Can someone verify that RootModule was added in V3? If so, let's update the documentation to be clear that we only support V3+ and close this issue.

from jump-location.

bpugh avatar bpugh commented on August 10, 2024

Yes I was running powershell V2 on Windows 7 and received the same error. I then updated to V3 and now it runs perfectly.

from jump-location.

tkellogg avatar tkellogg commented on August 10, 2024

Ok, I updated the readme to include the the dependency on V3+. It would be great if the dependency could be checked automatically but I'm closing this issue for now since it's now documented.

from jump-location.

bpugh avatar bpugh commented on August 10, 2024

Actually found the documentation for it here: http://technet.microsoft.com/library/hh849709.aspx
And under RootModule it says:
Note: In Windows PowerShell 2.0, this key was called "ModuleToProcess." You can use the "RootModule" parameter name or its "ModuleToProcess" alias.

So it looks like you could support V2 if you wanted by using the `ModuleToProcess' alias

from jump-location.

tkellogg avatar tkellogg commented on August 10, 2024

@bpugh Do you want to take a whack at this? I unfortunately don't have access to the Microsoft dev tools at the moment, so I'm reduced to groveling for people to contribute code.

from jump-location.

vors avatar vors commented on August 10, 2024

Should be easy. I renamed and reopen issue.

from jump-location.

bpugh avatar bpugh commented on August 10, 2024

Sure no problem! Alternatively you could actually enforce the version by setting PowerShellVersion = '3.0' in the same file.

from jump-location.

oising avatar oising commented on August 10, 2024

I think support for v2 would be nice - even if v3 or higher is installed, many of us must venture into v2 land (with the -version 2 switch) for dealing with sharepoint and exchange.

from jump-location.

bpugh avatar bpugh commented on August 10, 2024

So after messing around with this for a bit I seem to be stuck on an odd error.
I made the change I described above which is changing RootModule to ModuleToProcess but when I load my profile in PS v2 I get the following error:

[Jump-location] Database contains 1 records.

Import-Module : The module to process 'Load.ps1', listed in field 'ModuleToProcess' of module manifest 'C:\projects\jump-location\Jump.Location.psd1' 
was not processed because no valid module was found in any module directory.
At C:\Users\Brandon\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:8 char:14
+ Import-Module <<<<  'C:\projects\jump-location\Jump.Location.psd1'
    + CategoryInfo          : ResourceUnavailable: (Jump.Location:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

The odd thing is as you can see jump-location still starts up just fine and work just fine after that even though the error complains about not being able to find the file. I haven't been able to find a solution anywhere online.
Any thoughts?

from jump-location.

vors avatar vors commented on August 10, 2024

@bpugh I saw same thing, but didn't have time to investigate.

from jump-location.

bpugh avatar bpugh commented on August 10, 2024

Turns out it was just a matter of renaming the file. Apparently v2 is a stickler about modules having the proper .psm1 file extension.

from jump-location.

vors avatar vors commented on August 10, 2024

Nice work! Let me test it

from jump-location.

dragon788 avatar dragon788 commented on August 10, 2024

@vors Did you get a chance to test this and #34 ?

from jump-location.

vors avatar vors commented on August 10, 2024

@dragon788 I think both me and @tkellogg cannot allocate time to work on Jump-Location anymore.
@tkellogg maybe do a call for maintainers?

from jump-location.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.