SysTrayHost/Assemblies.ps1

Add-Type -assembly System
Add-Type -assembly System.Runtime.InteropServices
Add-Type -assembly System.Windows.Forms
Add-Type -assembly System.Data
Add-Type -assembly System.Drawing
Add-Type -assembly System.Design
    #---------------------
    # treeView checkboxes
    #---------------------
    # https://stackoverflow.com/questions/698369/how-to-disable-a-winforms-treeview-node-checkbox
    # P/invoke
    $TypeDefinition = @'
    using System;
    using System.Runtime.InteropServices;
    namespace Win32Functions {
        public class Win32Windows {
            [DllImport("user32.dll")]
            public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
 
            [DllImport("user32.dll")]
            public static extern bool IsIconic(IntPtr hWnd);
        }
    }
'@
                   
Add-Type -TypeDefinition $TypeDefinition #-PassThru