You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The [[https://github.com/joonro/Get-ChildItemColor/wiki][wiki]] has additional instructions and examples.
32
33
** Install from [[https://www.powershellgallery.com/packages/Get-ChildItemColor/][PowerShellGallery]]
33
34
PowerShellGet is required, which is included in Windows 10 and WMF5. If you
34
35
are using PowerShell V3 or V4, you will need to install [[https://www.microsoft.com/en-us/download/details.aspx?id=49186][PowerShellGet]].
35
36
36
37
Then, you can run =Install-Module Get-ChildItemColor=.
37
38
** Install from GitHub
38
-
After cloning the repo, you can put files in =/src= folder into
39
+
After cloning the repo or downloading the files, you can put files in =/src= folder into
39
40
=Get-ChildItemColor= folder under your =PSModulePath=
40
41
(e.g., =$ENV:UserProfile\Documents\PowerShell\Modules= for PowerShell 6 and
41
42
later). The =master= branch always contains the latest release version.
42
43
** Install from [[https://chocolatey.org][Chocolatey]]
43
44
The module is available as a [[https://chocolatey.org/packages/get-childitemcolor][Chocolatey package]]. Install it using =choco install get-childitemcolor=.
44
45
45
-
** Easiest way to use it in PowerShell 7
46
-
Download the sources from github.
47
-
48
-
Input in Powershell the command
49
-
=$Env:PSModulePath=
50
-
and look in the directories, which are there listed.
51
-
52
-
In the directory you search for, are already directories like "CimCmdlets", "Microsoft.PowerShell.Archive" and other.
53
-
Go to this directory called "Modules" and input in the PowerShell
54
-
=mkdir Get-ChildItemColor=
55
-
Go then in the created directory Get-ChildItemColor and copy inside it the files in the "src" directory of github called
It outputs now the file, where the Powershell looks for initialization.
62
-
If the directory to that file not exists, creating it.
63
-
And if the file not exists, creating it, too.
64
-
Now open the file in an text-editor like notepad.exe for example with
65
-
=notepad $PROFILE=
66
-
67
-
68
-
Input there the lines
69
-
70
-
#+begin_src powershell
71
-
Import-Module Get-ChildItemColor
72
-
Set-Alias -Name dir -Value Get-ChildItemColor -Option AllScope
73
-
Set-Alias -Name ls -Value Get-ChildItemColorFormatWide
74
-
#+end_src
75
-
76
-
and save it.
77
-
Now start the PowerShell again.
78
-
With the command "dir" you have a colord file list. With "ls" it is then in wide mode. And "gci" is still as default the old colorless output.
79
-
You can also use the outwritten normal commands "Get-ChildItemColor", "Get-ChildItemColorFormatWide" and "Get-ChildItem".
80
-
81
46
* Usage
82
47
When you import the module:
83
48
@@ -97,13 +62,17 @@ If (-Not (Test-Path Variable:PSise)) { # Only run this in the console and not i
97
62
Import-Module Get-ChildItemColor
98
63
99
64
Set-Alias l Get-ChildItemColor -option AllScope
100
-
Set-Alias ls Get-ChildItemColorFormatWide -option AllScope [-HideHeader] [-TrailingSlashDirectory]
65
+
Set-Alias ls Get-ChildItemColorFormatWide -option AllScope
101
66
}
102
67
#+end_src
103
68
104
69
So =l= yields colored output of =Get-ChildItem= and =ls= yields colored output
105
70
of =Get-ChildItem | Format-Wide= equivalent.
106
71
72
+
~Get-ChildItemColor~ has the following optional switch:
73
+
74
+
- -HumanReadableSize :: Unix style size string (e.g. M instead of MB, K instead of KB etc) (thanks to [[https://github.com/kforeverisback][kforeverisback]])
75
+
107
76
~Get-ChildItemColorFormatWide~ has the following optional switches:
108
77
109
78
- -HideHeader :: supress printing of headers (path on top).
0 commit comments