Skip to content

Instantly share code, notes, and snippets.

@JohnL4
Created November 20, 2024 20:54
Show Gist options
  • Save JohnL4/c2c8aed4f969a54af4a0dd20afe3502e to your computer and use it in GitHub Desktop.
Save JohnL4/c2c8aed4f969a54af4a0dd20afe3502e to your computer and use it in GitHub Desktop.
How to get a PowerShell pipeline to emit plain text, not objects
When invoking from PowerShell, you can pass a stream of file names in a pipeline as follows:
ls VP_CLIENT/*.sql -rec | select -expand FullName | py ../InternalTools/Export-VP_DDL/fix-anonymous-sequences.py
(The ``select -expand`` is key -- The list of filenames will appear on this script's stdin as lines of text.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment