header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

We have a new sponsor!  Introducting Pragma Systems.  See the home page for details.

Retrieving PowerShell errors
Last Post 26 Jan 2010 10:58 PM by Swackhammer1. 0 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Swackhammer1User is Offline
New Member
New Member
Posts:1
Avatar

--
26 Jan 2010 10:58 PM  
Hi, I need to be able to retrieve the error variable from a powershell cmd in .NET. Given below is some code: RunspaceInvoke myRunSpaceInvoke = new RunspaceInvoke(thisRunspace); string command = "Get-MailContact -Identity " + alias + " -DomainController " + domainController + " -ErrorVariable Err -ErrorAction SilentlyContinue"; results = myRunSpaceInvoke.Invoke(command).ToString(); I want 'results' to equal 'Err'. Any help would be appreciated. Thanks,
You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 footer
footer