Register
: :
Login
Home
Forums
Blogs
Podcast
Directories
Scripts
Downloads
Community
User Group Support
Learning Resources
We have a new sponsor! Introducting
Pragma Systems
. See the home page for details.
Unanswered
Active Topics
Forums
Search
Members
Forums
>
Using PowerShell
>
Working with .NET
Retrieving PowerShell errors
Last Post 26 Jan 2010 10:58 PM by
Swackhammer1
. 0 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
Swackhammer1
New Member
Posts:1
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.
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
Forums
>
Using PowerShell
>
Working with .NET
Active Forums 4.1
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008