Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Using .NET System.Diagnostics

Reply
 
Old 11-01-2006   #1 (permalink)
Marco Shaw


 
 

Using .NET System.Diagnostics

From the .NET SDK:

Code tracing and debugging in C#
System.Diagnostics.Trace.WriteLine("Hello World!");
System.Diagnostics.Debug.WriteLine("Hello World!");

How can I extend this to PSH? I must 'load' something first?

Marco



My System SpecsSystem Spec
Old 11-01-2006   #2 (permalink)
Lee Holmes [MSFT]


 
 

Re: Using .NET System.Diagnostics

Nope, you get this for free from our support of interaction with the .NET
Framework.

Step 1) Load a debug monitor (for example -- debug the process, or use
DbgView.exe from SysInternals)
Step 2) In PowerShell, type: [System.Diagnostics.Debug]::WriteLine("Hello
World!")

Most of the documentation and books talk about how to work with the .NET
Framework. From the documentation installed in your PowerShell installation
directory, you can find information in:

- the "Method Calls" section in the Quick Reference
- the "Using Classes and Methods" section in the User Guide.

They really are excellent resources, and are worth a quick read.

--
Lee Holmes [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Marco Shaw" <marco@Znbnet.nb.ca> wrote in message
news:ukrj%233c$GHA.144@TK2MSFTNGP02.phx.gbl...
> From the .NET SDK:
>
> Code tracing and debugging in C#
> System.Diagnostics.Trace.WriteLine("Hello World!");
> System.Diagnostics.Debug.WriteLine("Hello World!");
>
> How can I extend this to PSH? I must 'load' something first?
>
> Marco
>
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
should this return a System.Diagnostics.EventLog? PowerShell
Question about [System.Diagnostics.Process]::Start() PowerShell
Wrap command shell in System.Diagnostics.Process PowerShell
Why System.Diagnostics.EventLog needs an AliasProperty PowerShell
Using ProcessStartInfo with [System.Diagnostics.Process]::Start PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46