I was trying this:
$signature = @'
[DllImport("shell32.dll")]
public static extern int ShellExecuteW(
int hwnd,
string lpOperation,
string lpFile,
string lpParameters,
string lpDirectory,
int nShowCmd
);
'@
$exec = Add-Type -memberDefinition $signature -name "win" -namespace Win32Functions -passThru
$exec::ShellExecuteW(0, "open", "notepad.exe", 0, 0, 1)
but the notepad does not start. How do I write this down correctly?