Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
QuestionUsing strings from external .txt file Pin
Tetra10443-Feb-15 3:47
Tetra10443-Feb-15 3:47 
AnswerRe: Using strings from external .txt file Pin
OriginalGriff3-Feb-15 4:04
mveOriginalGriff3-Feb-15 4:04 
GeneralRe: Using strings from external .txt file Pin
Tetra10443-Feb-15 4:20
Tetra10443-Feb-15 4:20 
GeneralRe: Using strings from external .txt file Pin
OriginalGriff3-Feb-15 4:30
mveOriginalGriff3-Feb-15 4:30 
GeneralRe: Using strings from external .txt file Pin
Tetra10443-Feb-15 4:41
Tetra10443-Feb-15 4:41 
AnswerRe: Using strings from external .txt file Pin
BillWoodruff4-Feb-15 6:21
professionalBillWoodruff4-Feb-15 6:21 
GeneralRe: Using strings from external .txt file Pin
Tetra10445-Feb-15 3:06
Tetra10445-Feb-15 3:06 
QuestionHow to share a server connection between different powershell runspaces in c# on a web application Pin
tasoss2-Feb-15 21:37
tasoss2-Feb-15 21:37 
I'm working on a web project and I need to do the following. I want to run different cmdlets on a VMM server (https://technet.microsoft.com/en-us/library/dn246490.aspx).

Right now when I need to run a cmdlet I open a runspace, connect to the VMM server using this cmdlet:
https://technet.microsoft.com/library/jj613273%28v=sc.20%29.aspx and then disconnect.

The problem is that disconnect doesn't work as expected and so I have memory leaks.

The solution is to use one connection to the server,using the previous cmdlet, and then perform all other actions via this connection (on new runspaces).

So I need to share the fact that I'm connected on each new runspace I open. I suppose I should use the RunspacePool class and maybe the InitialSessionState member but I'm not sure.

Thanks for your help!

ps: http://stackoverflow.com/questions/28254778/how-to-share-a-server-connection-between-different-powershell-runspaces-in-c-sha[^]
QuestionRe: How to share a server connection between different powershell runspaces in c# on a web application Pin
Richard MacCutchan3-Feb-15 0:38
mveRichard MacCutchan3-Feb-15 0:38 
AnswerRe: How to share a server connection between different powershell runspaces in c# on a web application Pin
tasoss3-Feb-15 0:59
tasoss3-Feb-15 0:59 
SuggestionReceiving Windows Message in class library asynchronously in C# Pin
Ram Kumar2-Feb-15 18:07
Ram Kumar2-Feb-15 18:07 
GeneralRe: Receiving Windows Message in class library asynchronously in C# Pin
Richard Deeming4-Feb-15 1:53
mveRichard Deeming4-Feb-15 1:53 
QuestionStruct and Enum Pin
Member 111616252-Feb-15 18:05
Member 111616252-Feb-15 18:05 
AnswerRe: Struct and Enum Pin
OriginalGriff2-Feb-15 21:13
mveOriginalGriff2-Feb-15 21:13 
AnswerRe: Struct and Enum Pin
BillWoodruff3-Feb-15 21:01
professionalBillWoodruff3-Feb-15 21:01 
AnswerRe: Struct and Enum Pin
V.3-Feb-15 22:02
professionalV.3-Feb-15 22:02 
Questionhow do I change a regex Pin
Member 113543862-Feb-15 11:55
Member 113543862-Feb-15 11:55 
AnswerRe: how do I change a regex Pin
Tomáš Podešva2-Feb-15 17:14
professionalTomáš Podešva2-Feb-15 17:14 
AnswerRe: how do I change a regex Pin
OriginalGriff2-Feb-15 21:18
mveOriginalGriff2-Feb-15 21:18 
GeneralRe: how do I change a regex Pin
Member 113543863-Feb-15 14:03
Member 113543863-Feb-15 14:03 
GeneralRe: how do I change a regex Pin
OriginalGriff3-Feb-15 23:28
mveOriginalGriff3-Feb-15 23:28 
Questionwindows 8 hybrid shutdown notification Pin
morglorf2-Feb-15 11:33
morglorf2-Feb-15 11:33 
AnswerRe: windows 8 hybrid shutdown notification Pin
Richard Andrew x642-Feb-15 11:53
professionalRichard Andrew x642-Feb-15 11:53 
GeneralRe: windows 8 hybrid shutdown notification Pin
morglorf2-Feb-15 12:17
morglorf2-Feb-15 12:17 
GeneralRe: windows 8 hybrid shutdown notification Pin
morglorf3-Feb-15 5:54
morglorf3-Feb-15 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.