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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758207861, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/development/COM/interfaces/IShellDispatch/PowerShell(67): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78