Skip to content

Various problems with the Select-String help topic: incorrect alias name, unclear culture info #1651

@mklement0

Description

@mklement0

The sst alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0.

The actual alias name is sls.

When matching phrases, Select-String uses the current culture that is set for the system.

It is unclear what that means.

From what I can tell, the current culture is NOT respected, because non-string input is stringified in the same, culture-invariant manner as when string-expanding (inside "..."):

[cultureinfo]::CurrentCulture = 'de-DE';  get-date | sls .
09/12/2017 15:27:07    # You get this output format irrespective of the current culture

If the text is stored in files, use the Path parameter to specify the path to the files.

Also worth mentioning that Get-Item / Get-ChildItem output can be piped; for recursively searching all files in a directory subtree, piping output from Get-ChildItem -Recurse is the only (simple) option, given that Select-String itself doesn't support recursion.

Version(s) of document impacted

  • Impacts 6 document
  • Impacts 5.1 document
  • Impacts 5.0 document
  • Impacts 4.0 document
  • Impacts 3.0 document

Metadata

Metadata

Assignees

Labels

Pri3Priority - Low

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions