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.
User avatar
rkirchhof
Posts: 5
Joined: Sun Mar 03, 2013 12:42 pm

Re: Powershell cmd output to Textbox

Post by rkirchhof » Fri Apr 05, 2013 11:50 am

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
Joined: Sun Mar 03, 2013 12:44 pm

Re: Powershell cmd output to Textbox

Post by soccsupport » Fri Apr 05, 2013 12:08 pm

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.

Locked