Search notes:
Using the IShellDispatch interface in PowerShell
add-type -typeDefinition @'
using System;
using System.Runtime.InteropServices;
namespace tq84 {
public class shl {
public static void go() {
var shell = new Shell32();
var shellDispatch = (IShellDispatch)shell;
shellDispatch.MinimizeAll();
}
}
[ ComImport,
Guid("13709620-C279-11CE-A49E-444553540000")
]
class Shell32 {
}
[ ComImport,
Guid("D8F015C0-C278-11CE-A49E-444553540000")
]
[ InterfaceType(ComInterfaceType.InterfaceIsIDispatch)
]
public interface IShellDispatch {
void MinimizeAll();
}
}
'@
[tq84.shl]::go()