question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for passing script via stdin

See original GitHub issue

Summary of the new feature

It would be nice if Invoke-ScriptAnalyzer and Invoke-Formatter were able to accept a script via stdin. Most linters have an option for something like this. For my use case, it would be helpful for checking the PowerShell code generated by zoxide. Libraries that generate completions would also find it very useful to be able to check their code in tests.

Proposed technical implementation details (optional)

Invoke-ScriptAnalyzer and Invoke-Formatter should have some flag to accept a script via stdin.

What is the latest version of PSScriptAnalyzer at the point of writing

1.20.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ajeetdsouzacommented, Nov 3, 2021

This works, thanks!

0reactions
msftbot[bot]commented, Nov 3, 2021

Closing due to inactivity

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass a script with arguments via stdin as a string to the bash
Edit to my previous answer, the issue is due to the quoting of the input arguments thrown to Bash, as it sees the...
Read more >
Calling sh with script on stdin and passing command line ...
This tells the shell to read commands from the standard input, while accepting arguments on its command line (after the -s ) as...
Read more >
How to use stdin as argument for script? - UNIX and Linux ...
I'm trying to automatically pass user input values into a script that is being called from another script, below is my current script...
Read more >
How to write a script that accepts input from a file or ...
The command cat - reads from the keyboard. Summarising, if the script argument is ... In this case, we are passing a file...
Read more >
The many ways to pass code to Python from the terminal
Via stdin and piping ... Probably the most well-known way to pass code to python is via a file path. python spam.py. Specifying...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found