tkellogg / Jump-Location

Powershell `cd` that reads your mind
MIT License
467 stars 26 forks source link

Add support for PS v2 #34

Closed bpugh closed 8 years ago

bpugh commented 9 years ago

Fixes https://github.com/tkellogg/Jump-Location/issues/21

By using the alias 'ModuleToProcess' for 'RootModule' as well as renaming load.ps1 to have extension .psm1, which is the appropriate extension for powershell modules, jump-location is now backwards compatible with Powershell V2.

bpugh commented 9 years ago

Oops, sorry I missed that. Done.

vors commented 9 years ago

@bpugh I don't see updated version :) Did you push it?

bpugh commented 9 years ago

Sorry completely forgot about the build. I just pushed the changes.

bpugh commented 9 years ago

I can also squash the commits if you'd prefer...

vors commented 9 years ago

I get this error on fresh win server 2008 r2 VM: image

bpugh commented 9 years ago

That looks like a GAC issue. Is the min version of .Net installed?

vors commented 9 years ago

I have .net 2 and 4 on this machine (again, this is brand new VM): image We probably need to play with target .net version in csproj file to make it work.

bpugh commented 9 years ago

Agreed. The issue seems to be that it's referencing the 3.5 version of the assembly which your server is missing. Unfortunately I can't reproduce the error since I can't seem to get an environment in that state since every installer I found for .Net 2.0 automatically installs 3.5 as well. Should we just make 3.5 a minimum requirement?

bpugh commented 9 years ago

Actually I think we would have to at least require 3.5 since several of the assemblies referenced in the project aren't in 2.0 including Linq.

vors commented 9 years ago

Good point, 3.5+ is probably required. We need to make it work with 4 without 3.5 . This is error message that I get, when I replace v3.5 to v4.0 in TargetFrameworkVersion image

@bpugh I can give you VM for some time, mail me xvorsx at gmail.com

I think we can make release 0.6.0 without it. [Release will happens soon from release-0.6.0 branch]

bpugh commented 9 years ago

I think we need to leave it targeting 3.5 becuase Powershell v2 doesn't support .net 4.0. I tested it on a box with just .net 4 and PS v4 and it works fine since 4.0 supports running applications built against older versions of the framework.

vors commented 9 years ago

Current version of PR doesn't work with PS v2 (see error messages above)

bpugh commented 9 years ago

It does work with PS v2 you just need to have .Net 3.5 installed which most users probably have if they've been installing windows updates since it gets installed as an update to the 2.0 runtime. Basically if you're running v2 you need .Net 3.5 otherwise you just need .Net 4.0+

vors commented 9 years ago

Make sense. I tried use it after install of .net 3.5 Now problem is in Register-EngineEvent logic. The Job that should call UpdateTime has status 'NotStarted':

PS C:\Users> Get-Job | fl

Module : __DynamicModule_c6695c73-8c68-4f3a-a3ea-45cffa0391e5 StatusMessage : HasMoreData : False Location : Command : [Jump.Location.SetJumpLocationCommand]::UpdateTime($($(Get-Item -Path $(Get-Loc ation))).PSPath)

JobStateInfo : NotStarted Finished : System.Threading.ManualResetEvent InstanceId : 20436550-6389-482b-b758-b8274c7f5b9e Id : 1 Name : PowerShell.OnIdle ChildJobs : {} Output : {} Error : {} Progress : {} Verbose : {} Debug : {} Warning : {} State : NotStarted

vors commented 9 years ago

Currently Jump-Location on PS v2 doesn't track any info about current folder: UpdateTime callback is not called by OnIdle engine event.

vors commented 8 years ago

Closing this PR, since it was abandoned