Davlind / PSColor

Provides simple color highlighting for some PowerShell output
MIT License
174 stars 29 forks source link

get-childitem directory: shows wrong directory #16

Open veepee78 opened 6 years ago

veepee78 commented 6 years ago

Go to c:\windows directory and then get-childitem c:\users. -> directory: shows c:\windows, it should show c:\users.

vr8hub commented 6 years ago

This works fine for me. What exact version of Windows, what exact version of Powershell, what version of PSColor, did you install from here manually or from PowerShell Gallery, etc.?

veepee78 commented 6 years ago

win 10 1709 16299.309 x64 PSVersion 5.1.16299.251 Script 1.0.0.0 pscolor

Installed from powershell gallery, install-module..

PS C:\MaestroNG\Devel\Installation> Get-ChildItem c:\temp

Directory:  C:\MaestroNG\Devel\Installation

Mode LastWriteTime Length Name


d----- 24.10.2017 13.56 1 b d----- 18.10.2017 11.33 1 bb

vr8hub commented 6 years ago

That's what I'm on as well. I can't even imagine a scenario where PSColor would be interfering with this.

PS C:\windows\system32> get-computerinfo -property windows*

WindowsBuildLabEx              : 16299.15.amd64fre.rs3_release.170928-1534
WindowsCurrentVersion          : 6.3
WindowsEditionId               : Professional
WindowsInstallationType        : Client
WindowsInstallDateFromRegistry : 2/27/2018 9:49:00 PM
WindowsProductId               : 00330-80000-00000-AA917
WindowsProductName             : Windows 10 Pro
WindowsRegisteredOrganization  :
WindowsRegisteredOwner         : Windows User
WindowsSystemRoot              : C:\Windows
WindowsVersion                 : 1709

PS C:\windows\system32> $psversiontable.psversion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      16299  251

PS C:\windows\system32> get-module pscolor

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.0.0    pscolor                             Out-Default

PS C:\windows\system32> get-childitem c:\temp

    Directory:  C:\temp

Mode                LastWriteTime     Length  Name
----                -------------     ------  ----
-a----        5/16/2017   3:30 PM       2653 vrice.pfx
veepee78 commented 6 years ago

Well, I am able to reproduce this on my home computer as well. Similar specs. Exactly same result as with the work computer. I didn't have anything powershell related installed on my home machine.

Install-Module pscolor Import-Module PSColor PS C:> dir C:\Temp\

Directory:  C:\

Mode LastWriteTime Length Name


d----- 18.3.2018 23:12 1 NVIDIA

Here with debug: (just dir c:\temp)

PS C:> C:\Users\veepee\Documents\test.ps1 Hit Line breakpoint on 'C:\Users\veepee\Documents\test.ps1:2' [DBG]: PS C:>> Stopped at: { [DBG]: PS C:>> Stopped at: if(($ -is [System.IO.DirectoryInfo]) -or ($ -is [System.IO.FileInfo])) [DBG]: PS C:>> Stopped at: FileInfo $_ [DBG]: PS C:>>

Directory:  C:\

Mode LastWriteTime Length Name


d----- 18.3.2018 23:12 1 NVIDIA Stopped at: $ = $null [DBG]: PS C:>> Stopped at: $steppablePipeline.Process($) [DBG]: PS C:>> Stopped at: }

and one more time with and without the module..

PS C:\Users\veepee> dir c:\temp

Directory: C:\temp

Mode LastWriteTime Length Name


d----- 18.3.2018 23:12 NVIDIA -a---- 10.1.2018 18:16 2240808 fe1dbb5a98cb4443939b32b1858eec08-le64.cache-4 -a---- 30.10.2016 13:08 231028 rep.html -a---- 9.12.2017 2:23 9734 t.txt

PS C:\Users\veepee> Import-Module PSColor PS C:\Users\veepee> dir c:\temp

Directory:  C:\Users\veepee

Mode LastWriteTime Length Name


d----- 18.3.2018 23:12 1 NVIDIA -a---- 10.1.2018 18:16 2,14MB fe1dbb5a98cb4443939b32b1858eec08-le64.cache-4 -a---- 30.10.2016 13:08 225,61KB rep.html -a---- 9.12.2017 2:23 9,51KB t.txt

PS C:\Users\veepee>

vr8hub commented 6 years ago

Weird. I have two Win10 VM's, both work as I showed above. I've never seen anything like that as long as I've been using PSColor (since I started playing with Win10, say six months or so). Sorry I can't be of more help. David (the author) might have an idea, but he doesn't frequent here very often these days.

Just for grins you might get the latest pscolor.zip from here and install it and see if it makes a difference. It has a change to allow the module to be removed (the way the original worked it borked the system if it was removed). It shouldn't matter — the example I posted earlier was from a stock PowerShell Gallery install just like yours.

You might also try the usual troubleshooting steps — e.g. boot into Safe mode and see if it happens there, etc.

HisRoyalRedness commented 6 years ago

I've got the same problem, and have experienced it right from day 1 (when I first installed PSColor many years ago). I've just installed the latest version (by extracting from the zip file). I'm running on Windows 10 Pro, build 10.0.16299

I've got a directory structure as follows: image

The output of gci -r c:\pccolortest without the PSColor module... image

The output of gci -r c:\pccolortest with the PSColor module... image

vr8hub commented 6 years ago

(Disclaimer: I'm not the developer, just a contributor.)

I believe you, I just can't help you, because I can't reproduce the problem. I've never had the issue (three different machines, multiple VM's), either with the original version of PsColor, or with the various updates I've made to it (some local only). I'm on Win10 1709 though, so it's possible (though unlikely IMO) that might make a difference.

On May 17, 2018, at 4:49 PM, Keith Fletcher notifications@github.com wrote:

I've got the same problem, and have experienced it right from day 1 (when I first installed PCColor many years ago). I've just installed the latest version (by extracting from the zip file). In running on Windows 10 Pro, build 10.0.16299

I've got a directory structure as follows: https://user-images.githubusercontent.com/3274184/40205588-b2c5708e-5a80-11e8-962b-b1cf937f688b.png The output of gci -r c:\pccolortest without the PSColor module... https://user-images.githubusercontent.com/3274184/40205478-4b2d3b1e-5a80-11e8-9a46-f3f1ccaae7aa.png The output of gci -r c:\pccolortest with the PSColor module... https://user-images.githubusercontent.com/3274184/40205522-6e0b5f44-5a80-11e8-8ac9-3d71d66bc83b.png

veepee78 commented 6 years ago

I'm sorry, I thought I posted solution. It was a conflict with another addon. It's couple of months back, I cant remember anymore what was the conflicting addon. I believe I did load it through profile.