├── 1.6_ConfigMgr TS Monitor.ps1 ├── LICENSE ├── README.md └── Versions └── ConfigMgr_Task_Sequence_Monitor.xml /1.6_ConfigMgr TS Monitor.ps1: -------------------------------------------------------------------------------- 1 | #requires -Version 3 2 | 3 | #region Add Assemblies 4 | Add-Type -AssemblyName PresentationFramework, System.Drawing, System.Windows.Forms, WindowsFormsIntegration 5 | $code = @" 6 | using System; 7 | using System.Drawing; 8 | using System.Runtime.InteropServices; 9 | 10 | namespace System 11 | { 12 | public class IconExtractor 13 | { 14 | 15 | public static Icon Extract(string file, int number, bool largeIcon) 16 | { 17 | IntPtr large; 18 | IntPtr small; 19 | ExtractIconEx(file, number, out large, out small, 1); 20 | try 21 | { 22 | return Icon.FromHandle(largeIcon ? large : small); 23 | } 24 | catch 25 | { 26 | return null; 27 | } 28 | 29 | } 30 | [DllImport("Shell32.dll", EntryPoint = "ExtractIconExW", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] 31 | private static extern int ExtractIconEx(string sFile, int iIndex, out IntPtr piLargeVersion, out IntPtr piSmallVersion, int amountIcons); 32 | 33 | } 34 | } 35 | "@ 36 | Add-Type -TypeDefinition $code -ReferencedAssemblies System.Drawing 37 | 38 | # Mahapps Library 39 | if (Test-Path -Path "$env:ProgramFiles\SMSAgent\ConfigMgr Task Sequence Monitor\MahApps.Metro.dll") 40 | { 41 | [System.Reflection.Assembly]::LoadFrom("$env:ProgramFiles\SMSAgent\ConfigMgr Task Sequence Monitor\MahApps.Metro.dll") | out-null 42 | [System.Reflection.Assembly]::LoadFrom("$env:ProgramFiles\SMSAgent\ConfigMgr Task Sequence Monitor\System.Windows.Interactivity.dll") | out-null 43 | } 44 | 45 | if (Test-Path -Path "${env:ProgramFiles(x86)}\SMSAgent\ConfigMgr Task Sequence Monitor\MahApps.Metro.dll") 46 | { 47 | [System.Reflection.Assembly]::LoadFrom("${env:ProgramFiles(x86)}\SMSAgent\ConfigMgr Task Sequence Monitor\MahApps.Metro.dll") | out-null 48 | [System.Reflection.Assembly]::LoadFrom("${env:ProgramFiles(x86)}\SMSAgent\ConfigMgr Task Sequence Monitor\System.Windows.Interactivity.dll") | out-null 49 | } 50 | 51 | #endregion 52 | 53 | #region GUI and Variables 54 | ### Main Window ### 55 | [xml]$xaml = @" 56 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 107 | 108 | 109 | 110 |