header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Retrieving PowerShell errors
Last Post 26 Jan 2010 02: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 02: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.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer