Powershell cmd output to Textbox

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
rkirchhof
Posts: 5
Last visit: Mon Apr 08, 2013 5:50 am

Re: Powershell cmd output to Textbox

Post by rkirchhof »

I had a situation where try catch wasn't working. Try putting

Code: Select all

$ErrorActionPreference = “Stop”
before the command. Here's where I found it.

http://www.codesmartnothard.com/2011/07 ... rking.aspx
User avatar
soccsupport
Posts: 17
Last visit: Mon Dec 23, 2019 11:44 am

Re: Powershell cmd output to Textbox

Post by soccsupport »

Agreed. Based on my further research and also trying the -erroractoin -stop try/catch; no luck.

In any case I really appreciate your help. Thank you. I learned more commands which is always cool in my book.
This topic is 11 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked