Add-Type

Add-Type keyword lets us use the .NET framework to compile C# code containing Win32 API declarations and then call them.

Example code:

The GetUserName function retrieves the name of the user associated with the current thread.

Last updated