I mean to colorize the output of ls
.
I checked Powershell: Properly coloring Get-Childitem output once and for all.
The two options appear to be:
- Use
New-CommandWrapper
, as advocated in the OP and the answer by Jon Z. - Use module
PSColor
.
I obtained the code for New-CommandWrapper
from the OP (it is the same as provided by O'Reilly), placed it in file New-CommandWrapper.ps1
, and dot source it in my profile.ps1
.
Now when I open a new session I get
cmdlet New-CommandWrapper.ps1 at command pipeline position 1
Supply values for the following parameters:
Name:
Is this ok? If so, what should I enter? Or how do I fix this? (I am certain the issue is quite simple).
Note: I couldn't make PSColor
work, and this is possibly worth a another question.
As mentioned in a comment, after importing the module, (almost?) any cmdlet outputs
Value cannot be null.
Parameter name: command
En línea: 39 Carácter: 9
+ $steppablePipeline.Begin($PSCmdlet)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
EDIT:
With the modification suggested by Thomas, the problem changed.
Now I get the same Value cannot be null.
error.
I would like to conclude that his suggestion is right, and I solved one of the many chained problems I had... but I cannot be sure.