Skip to content

Commit

Permalink
Merge tag 'v3.5.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
joonro committed Aug 3, 2024
2 parents 7c2ead6 + d73b021 commit 3f3592f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 39 deletions.
45 changes: 7 additions & 38 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -29,55 +29,20 @@ It provides two main functionalities:
** Get-ChildItemColorFormatWide (=ls= equivalent)
[[file:./screenshots/Get-ChildItemColorFormatWide.png]]
* Install
- The [[https://github.com/joonro/Get-ChildItemColor/wiki][wiki]] has additional instructions and examples.
** Install from [[https://www.powershellgallery.com/packages/Get-ChildItemColor/][PowerShellGallery]]
PowerShellGet is required, which is included in Windows 10 and WMF5. If you
are using PowerShell V3 or V4, you will need to install [[https://www.microsoft.com/en-us/download/details.aspx?id=49186][PowerShellGet]].

Then, you can run =Install-Module Get-ChildItemColor=.
** Install from GitHub
After cloning the repo, you can put files in =/src= folder into
After cloning the repo or downloading the files, you can put files in =/src= folder into
=Get-ChildItemColor= folder under your =PSModulePath=
(e.g., =$ENV:UserProfile\Documents\PowerShell\Modules= for PowerShell 6 and
later). The =master= branch always contains the latest release version.
** Install from [[https://chocolatey.org][Chocolatey]]
The module is available as a [[https://chocolatey.org/packages/get-childitemcolor][Chocolatey package]]. Install it using =choco install get-childitemcolor=.

** Easiest way to use it in PowerShell 7
Download the sources from github.

Input in Powershell the command
=$Env:PSModulePath=
and look in the directories, which are there listed.

In the directory you search for, are already directories like "CimCmdlets", "Microsoft.PowerShell.Archive" and other.
Go to this directory called "Modules" and input in the PowerShell
=mkdir Get-ChildItemColor=
Go then in the created directory Get-ChildItemColor and copy inside it the files in the "src" directory of github called
"FileInfo.ps1", "Get-ChildItemColor.psd1", "Get-ChildItemColor.psm1", "Get-ChildItemColorTable.ps1", "MatchInfo.ps1",
"ProcessInfo.ps1", "PSColorHelper.ps1", "ServiceController.ps1"

Now input in the Powershell the command
=$PROFILE=
It outputs now the file, where the Powershell looks for initialization.
If the directory to that file not exists, creating it.
And if the file not exists, creating it, too.
Now open the file in an text-editor like notepad.exe for example with
=notepad $PROFILE=


Input there the lines

#+begin_src powershell
Import-Module Get-ChildItemColor
Set-Alias -Name dir -Value Get-ChildItemColor -Option AllScope
Set-Alias -Name ls -Value Get-ChildItemColorFormatWide
#+end_src

and save it.
Now start the PowerShell again.
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.
You can also use the outwritten normal commands "Get-ChildItemColor", "Get-ChildItemColorFormatWide" and "Get-ChildItem".

* Usage
When you import the module:

Expand All @@ -97,13 +62,17 @@ If (-Not (Test-Path Variable:PSise)) { # Only run this in the console and not i
Import-Module Get-ChildItemColor

Set-Alias l Get-ChildItemColor -option AllScope
Set-Alias ls Get-ChildItemColorFormatWide -option AllScope [-HideHeader] [-TrailingSlashDirectory]
Set-Alias ls Get-ChildItemColorFormatWide -option AllScope
}
#+end_src

So =l= yields colored output of =Get-ChildItem= and =ls= yields colored output
of =Get-ChildItem | Format-Wide= equivalent.

~Get-ChildItemColor~ has the following optional switch:

- -HumanReadableSize :: Unix style size string (e.g. M instead of MB, K instead of KB etc) (thanks to [[https://github.com/kforeverisback][kforeverisback]])

~Get-ChildItemColorFormatWide~ has the following optional switches:

- -HideHeader :: supress printing of headers (path on top).
Expand Down
2 changes: 1 addition & 1 deletion src/Get-ChildItemColor.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
RootModule = 'Get-ChildItemColor.psm1'

# Version number of this module.
ModuleVersion = '3.4.0'
ModuleVersion = '3.5.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down

0 comments on commit 3f3592f

Please sign in to comment.