Search notes:

Using the IShellDispatch interface in PowerShell

The following example tries to demsontrate how the IShellDispatch interface might be used 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()

Index