Comments (5)
Thought it might do with capturing of the error stream, but this caused the same behavior:
$Prompt.Add( { $(try{throw "error"}catch{} *>&1)} )
from powerline.
You'll have to Set-PowerLinePrompt -HideErrors
PowerShell doesn't care that you're handling the error. I filed PowerShell/PowerShell#3768 about this years ago.
Basically, we're always invoking your scriptblock within a script cmdlet with -ErrorVariable
, something like this:
. { [CmdletBinding()]param()
try { throw "error" } catch {}
} -ErrorVariable logging
It doesn't matter that you handled the exception -- it still shows up in the ErrorVariable, and there's nothing I can do about it except ignore all the errors (the way I do, if you set -HideErrors
true).
from powerline.
How about a way to ignore the error for a specific variable - base on output - or maybe even adding a custom object to the ErrorVariable?
I understand it's hacky as hell, but then again, sometimes a hack makes sense.
from powerline.
PowerShell doesn't care that you're handling the error. I filed PowerShell/PowerShell#3768 about this years ago.
Thanks for that.
One bizarre thread, a lively discussion, with an agreement from the PowerShell-committe throughout the course of a few month back in 2017.
Almost implemented in 2019, accepted by the committee once more in 2020, only to be dropped because of an overworked engineer.
Is this like this all the time? asking as you've been 'around the block' more than me.
from powerline.
Related Issues (20)
- PowerLine fails to import saved prompt including a single-quoted string HOT 2
- Get-SegmentedPath variably handles alternative PSDrives with bugs
- Conditional block colors HOT 1
- Special characters is not shown in powershell. HOT 4
- List available blocks + how to add them.
- Run this every time ? HOT 2
- Install fails without -AllowClobber HOT 1
- Can't install with Pansies 1.4.0-beta03 HOT 1
- Error with separator HOT 1
- Support for no background colour HOT 4
- Loading profile info from Documents\WindowsPowerShell even when running on PSCore HOT 1
- Where is the prompt settings stored? HOT 4
- Doesn't work in Powershell Core HOT 3
- Needed to install prerelease Pansies HOT 4
- Error With New PowerShell 7.1 preview 2 - Get-Date Usage Needs Full Parameter Name HOT 2
- Exception in PowerLinePrompt HOT 7
- PowerLine 3.4.0 fails to read a config that worked with 3.3.0 HOT 8
- Req: A community theme repo HOT 2
- What is the correct way to write a clear final separator?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerline.