diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 23c5338..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Assembly -Modules -Utilities diff --git a/App/AdminMenu.ps1 b/AdminMenu.ps1 similarity index 84% rename from App/AdminMenu.ps1 rename to AdminMenu.ps1 index d2ee6f7..bc51c39 100644 --- a/App/AdminMenu.ps1 +++ b/AdminMenu.ps1 @@ -1,4 +1,4 @@ -#======================================================================== +#======================================================================== # # Title: Admin Run-As Menu # Created: 2016-11-03 @@ -161,6 +161,7 @@ Start-Log -FilePath "$env:LocalAppData\AdminMenu\Logs\$(Get-Date -Format yyyyMMd ## Variables: Script Name and Script Paths [string]$scriptPath = $MyInvocation.MyCommand.Definition [string]$scriptName = [IO.Path]::GetFileNameWithoutExtension($scriptPath) +[string]$scriptFileName = Split-Path -Path $scriptPath -Leaf [string]$scriptRoot = Split-Path -Path $scriptPath -Parent [string]$invokingScript = (Get-Variable -Name 'MyInvocation').Value.ScriptName @@ -180,17 +181,17 @@ Else { [string]$XamlPath = Join-Path -Path $scriptRoot -ChildPath 'Resources' [string]$ModulesPath = Join-Path -Path $scriptRoot -ChildPath 'Modules' [string]$UtilPath = Join-Path -Path $scriptRoot -ChildPath 'Utilities' -[string]$ConfigPath = Join-Path -Path $scriptRoot -ChildPath 'Configs' -[string]$MenuScriptsPath = Join-Path -Path $scriptRoot -ChildPath 'Scripts' # When Using Executable Command Line If ($ConfigCommandLine){ [string]$ConfigFile = Join-Path -Path $scriptRoot -ChildPath $ConfigCommandLine } Else{ - [string]$ConfigFile = Join-Path -Path $ConfigPath -ChildPath 'AdminMenu.ps1.config' + [string]$ConfigFile = Join-Path -Path $scriptRoot -ChildPath 'AdminMenu.ps1.config' } -[string]$NameFile = Join-Path -Path $ConfigPath -ChildPath 'AdminMenu.prereqs' +[string]$NameFile = Join-Path -Path $scriptRoot -ChildPath 'AdminMenu.ps1.names' + +[string]$appAuthor = 'Richard Tracy' #======================================================= # PARSE CONFIG FILE #======================================================= @@ -205,7 +206,6 @@ Else{ [Xml.XmlElement]$xmlMenuOptions = $xmlConfig.Menu_Options [boolean]$AppOptionRequireAdmin = [boolean]::Parse($xmlMenuOptions.Option_RequireAdmin) [boolean]$AppOptionRSATCheck = [boolean]::Parse($xmlMenuOptions.Option_RSATCheck) -[boolean]$AppPrereqCheck = [boolean]::Parse($xmlMenuOptions.Option_PrereqCheck) [boolean]$AppOptionDebugeMode = [boolean]::Parse($xmlMenuOptions.Option_DebugMode) [string]$AppOptionAccent = $xmlMenuOptions.Option_Accent [string]$AppOptionTheme = $xmlMenuOptions.Option_Theme @@ -215,6 +215,7 @@ Else{ [boolean]$AppUIHideButtons = [boolean]::Parse($xmlUIControls.Control_HideUnusedButtons) [boolean]$AppUIHideCredManager = [boolean]::Parse($xmlUIControls.Control_HideCredManager) [boolean]$AppUIHideQuickAccess = [boolean]::Parse($xmlUIControls.Control_HideQuickAccess) +[string]$AppUIQuickAccessPosition = $xmlUIControls.Control_QuickAccessPosition [boolean]$AppUIDisableOptionMenu = [boolean]::Parse($xmlUIControls.Control_DisableUserOption) # Get Menu Configurations [Xml.XmlElement]$xmlMenuConfigs = $xmlConfig.Menu_Configs @@ -224,8 +225,8 @@ Else{ #check if remote config will be used and path is accessible If (($AppUseRemoteConfig) -and (Test-Path $AppRemotePath) -and (!$ForceLocal)){ - [string]$remoteConfig = Join-Path -Path $AppRemotePath -ChildPath '\Configs\AdminMenu.ps1.config' -ErrorAction SilentlyContinue - [string]$remoteNames = Join-Path -Path $AppRemotePath -ChildPath '\Configs\AdminMenu.prereqs' -ErrorAction SilentlyContinue + [string]$remoteConfig = Join-Path -Path $AppRemotePath -ChildPath 'AdminMenu.ps1.config' -ErrorAction SilentlyContinue + [string]$remoteNames = Join-Path -Path $AppRemotePath -ChildPath 'AdminMenu.ps1.names' -ErrorAction SilentlyContinue If (-not (Test-Path $remoteConfig -ErrorAction SilentlyContinue) -and (-not (Test-Path $remoteNames -ErrorAction SilentlyContinue)) ){ If ($AppOptionDebugeMode){Write-Log -Message "Remote config files were not found at: $AppRemotePath; local config will be processed instead" -Severity 2 -OutputHost} [boolean]$AppUseRemoteConfig = $False @@ -595,7 +596,7 @@ $notifyicon.BalloonTipText = $BalloonMsg #Call the balloon notification $ExitItem = New-Object System.Windows.Forms.MenuItem -$ExitItem.Text = "Exit Tool" +$ExitItem.Text = "Exit" # When Exit is clicked, close everything and kill the PowerShell process $ExitItem.add_Click({ $App.Close() @@ -606,103 +607,108 @@ $ExitItem.add_Click({ If(!$envRunningInISE){Stop-Process $pid} }) + $DebugItem = New-Object System.Windows.Forms.MenuItem $DebugItem.Text = "Show Debug Console" -$DebugItem.Add_Click({ - If (Show-PSConsole){ - Hide-PSConsole - $DebugItem.Text = 'Show Debug Console' - } - Else { - Show-PSConsole - $DebugItem.Text = 'Hide Debug Console' - write-host "Use the 'Hide Debug button' from the context menu in the taskbar icon to close this debug window. - `nIf closed with the X button, it will close the menu as well" -ForegroundColor Yellow -BackgroundColor Black - } -}) +$DebugItem.Add_Click({Toggle-PSConsole}) + +$PSOBItem = New-Object System.Windows.Forms.MenuItem +$PSOBItem.Text = "Object Browser" +$PSOBItem.Add_Click({Start-ButtonProcess -ProcessCall ps1 -File "PSObjectBrowser.ps1" -CreateNoWindow}) $AboutItem = New-Object System.Windows.Forms.MenuItem $AboutItem.Text = "About" $AboutItem.Add_Click({Open-AboutWindow}) -$QuickItem = New-Object System.Windows.Forms.MenuItem -$QuickItem.Text = "Quick Access" +#$SeperatorItem = New-Object System.Windows.Forms.SplitContainer +$SeperatorItem1 = New-Object System.Windows.Forms.MenuItem +$SeperatorItem1.Text = "-" -$SeperatorItem = New-Object System.Windows.Forms.MenuItem -$SeperatorItem.Text = "──────────────────" -$SeperatorItem.Enabled = $false +$SeperatorItem2 = New-Object System.Windows.Forms.MenuItem +$SeperatorItem2.Text = "-" -If (!$AppUIHideQuickAccess){ - $contextmenu = New-Object System.Windows.Forms.ContextMenu - $notifyicon.ContextMenu = $contextmenu - If ($AppOptionDebugeMode -and !$envRunningInISE){ - $notifyicon.contextMenu.MenuItems.AddRange(@($DebugItem,$QuickItem,$SeperatorItem,$AboutItem,$ExitItem)) - } - Else { - $notifyicon.contextMenu.MenuItems.AddRange(@($QuickItem,$SeperatorItem,$AboutItem,$ExitItem)) - } - $quickitem.add_Click({Launch-QuickMenu}) -} -Else{ - $contextmenu = New-Object System.Windows.Forms.ContextMenu - $notifyicon.ContextMenu = $contextmenu - If ($AppOptionDebugeMode -and !$envRunningInISE){ - $notifyicon.contextMenu.MenuItems.AddRange(@($DebugItem,$SeperatorItem,$AboutItem,$ExitItem)) - } - Else { - $notifyicon.contextMenu.MenuItems.AddRange(@($AboutItem,$ExitItem)) - } +$contextmenu = New-Object System.Windows.Forms.ContextMenu +$notifyicon.ContextMenu = $contextmenu +If ($AppOptionDebugeMode -and !$envRunningInISE){ + $notifyicon.contextMenu.MenuItems.AddRange(@($DebugItem,$PSOBItem,$SeperatorItem2,$AboutItem,$SeperatorItem1,$ExitItem)) +} +Else { + $notifyicon.contextMenu.MenuItems.AddRange(@($PSOBItem,$SeperatorItem2,$AboutItem,$SeperatorItem1,$ExitItem)) } -# Add a left click that makes the Window appear -# part of the screen, above the notify icon. -$notifyicon.add_Click({ - #if ($_.Button -eq [Windows.Forms.MouseButtons]::Left) { - $App.Add_Closing({$_.Cancel = $True}) - $App.Hide() # ensures the window isn't already open - $App.Add_Closing({$_.Cancel = $False}) - $App.Show() - #} -}) - - +$notifyicon.add_Click({Show-Menu}) +$notifyicon.add_DoubleClick({Show-Menu}) ##*============================== ##* LOAD FORM - Open / Hide App Button ##*============================== -$OApp.Hide() -# reposition each time, in case the resolution or monitor changes $OApp.Topmost = $True -$OApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$OApp.Width)-20 -$OApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$OApp.Height)-15 - - -$OAppbtnOpenApp.add_Click({ - $OApp.Hide() - $HApp.Show() - $HApp.Activate() - - $App.Add_Closing({$_.Cancel = $False}) - $App.Show() -}) - - -$HApp.Show() -# reposition each time, in case the resolution or monitor changes $HApp.Topmost = $True -$HApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$OApp.Width)-20 -$HApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$OApp.Height)-15 -$HAppbtnHideApp.add_Click({ - $HApp.Hide() - $OApp.Show() - $OApp.Activate() +Switch ($AppUIQuickAccessPosition) + { + "BottomLeft" + { + $OApp.Left = 20 + $OApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$OApp.Height)-15 + $HApp.Left = 20 + $HApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$HApp.Height)-15 + } + "BottomCenter" + { + $OApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$OApp.Width)/2 + $OApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$OApp.Height)-15 + $HApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$HApp.Width)/2 + $HApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$HApp.Height)-15 + } + "BottomRight" + { + $OApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$OApp.Width)-20 + $OApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$OApp.Height)-15 + $HApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$HApp.Width)-20 + $HApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$HApp.Height)-15 + } + "TopLeft" + { + $OApp.Left = 20 + $OApp.Top = 30 + $HApp.Left = 20 + $HApp.Top = 30 + } + "TopCenter" + { + $OApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$OApp.Width)/2 + $OApp.Top = 30 + $HApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$HApp.Width)/2 + $HApp.Top = 30 + } + "TopRight" + { + $OApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$OApp.Width)-20 + $OApp.Top = 30 + $HApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$HApp.Width)-20 + $HApp.Top = 30 + } + "LeftCenter" + { + $OApp.Left = 20 + $OApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$OApp.Height)/2 + $HApp.Left = 20 + $HApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$HApp.Height)/2 + } + "RightCenter" + { + $OApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$OApp.Width)-20 + $OApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$OApp.Height)/2 + $HApp.Left = $([System.Windows.SystemParameters]::WorkArea.Width-$HApp.Width)-20 + $HApp.Top = $([System.Windows.SystemParameters]::WorkArea.Height-$HApp.Height)/2 + } + + } - $App.Add_Closing({$_.Cancel = $True}) - $App.Hide() - #$notifyicon.ShowBalloonTip(5) -}) +$OAppbtnOpenApp.add_Click({Show-Menu}) +$HAppbtnHideApp.add_Click({Hide-Menu}) ##*============================== ##* LOAD FORM - APP CONTENT AND BUTTONS @@ -710,7 +716,7 @@ $HAppbtnHideApp.add_Click({ #$App.Opacity = 0.95 #create Local directory for user settings -New-Item "$envLocalAppData\AdminMenu" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null +New-Item "$env:LocalAppData\AdminMenu" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null Write-OutputBox -OutputBoxMessage "Loading $AppTitle [ver. $AppVersion]" -Type "START: " -Object tab1 If ($AppOptionDebugeMode){Get-FormVariables} @@ -759,27 +765,11 @@ Else{ #$WPFbtnOptions.Add_Click({$WPFFlyOutContent.IsOpen = $true}) } -$WPFbtnHide.Add_Click({ - $HApp.Hide() - $OApp.Show() - $OApp.Activate() - - $App.Add_Closing({$_.Cancel = $True}) - $App.Hide() - $notifyicon.ShowBalloonTip(5) -}) +$WPFbtnHide.Add_Click({Hide-Menu -ShowTip}) # Hide the window if it loses focus If ($AppUIHideApp){ - $App.Add_Deactivated({ - $HApp.Hide() - $OApp.Show() - $OApp.Activate() - - $App.Add_Closing({$_.Cancel = $True}) - $App.Hide() - $notifyicon.ShowBalloonTip(5) - }) + $App.Add_Deactivated({Hide-Menu -ShowTip}) } #App Window (top right) Exit button @@ -804,21 +794,10 @@ $App.Add_KeyDown({ Change-TabItem -increment 1 } "UP" { - $OApp.Hide() - $HApp.Show() - $HApp.Activate() - - $App.Add_Closing({$_.Cancel = $False}) - $App.Show() + Show-Menu -OnTop } "DOWN" { - $HApp.Hide() - $OApp.Show() - $OApp.Activate() - - $App.Add_Closing({$_.Cancel = $True}) - $App.Hide() - $notifyicon.ShowBalloonTip(5) + Hide-Menu -ShowTip } Default {$Null} } @@ -863,32 +842,29 @@ $App.Icon = $AppBitmap # Allow input to window for TextBoxes, etc [Void][System.Windows.Forms.Integration.ElementHost]::EnableModelessKeyboardInterop($App) -# Make PowerShell Window Disappear -If(!$envRunningInISE){Hide-PSConsole} # hide the console at start when running exe +If(!$envRunningInISE){ + #Hide-PSConsole # hide the console at start when running exe + # Make PowerShell Disappear  + $windowcode = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);' + $asyncwindow = Add-Type -MemberDefinition $windowcode -name Win32ShowWindowAsync -namespace Win32Functions -PassThru + $null = $asyncwindow::ShowWindowAsync((Get-Process -PID $pid).MainWindowHandle, 0) +} -<# -$windowcode = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);' -$asyncwindow = Add-Type -MemberDefinition $windowcode -name Win32ShowWindowAsync -namespace Win32Functions -PassThru -$null = $asyncwindow::ShowWindowAsync((Get-Process -PID $pid).MainWindowHandle, 0) -#> +Show-Menu -OnTop +# Force garbage collection just to start slightly lower RAM usage. [System.GC]::Collect() [System.GC]::WaitForPendingFinalizers() -# This makes it pop up -$App.Show() -# This makes it the active window -$App.Activate() | Out-Null - Try{ $AppWindowState = [System.Windows.Forms.FormWindowState]::Normal $App.WindowState = $AppWindowState } Catch { $ErrorMessage = $_.Exception.Message - Write-Host "Unable to set WindosState. May be unsupported in OS version" + Write-Host "Unable to set WindowsState. May be unsupported in OS version" } # Create an application context for it to all run within. # This helps with responsiveness, especially when clicking Exit. $appContext = New-Object System.Windows.Forms.ApplicationContext -[System.Windows.Forms.Application]::Run($appContext) +[System.Windows.Forms.Application]::Run($appContext) \ No newline at end of file diff --git a/App/Configs/AdminMenu.ps1.config b/AdminMenu.ps1.config similarity index 94% rename from App/Configs/AdminMenu.ps1.config rename to AdminMenu.ps1.config index 382696a..029494a 100644 --- a/App/Configs/AdminMenu.ps1.config +++ b/AdminMenu.ps1.config @@ -6,19 +6,18 @@ Richard Tracy Admin Run-As Menu 3.9.9.3 - 07/14/2018 + 12/8/2016 True True - True True @@ -30,7 +29,12 @@ False False False - True + True + TopCenter + True @@ -52,7 +56,7 @@ AdminMenuExtensions.ps1 AdminMenuPrereqOptions.ps1 - scripts\Invoke-Runspace.ps1 + Tools\Invoke-Runspace.ps1 ImageBase64Resources.ps1 SystemFunctions.ps1 ADFunctions.ps1 @@ -64,9 +68,7 @@ True - + Extensions\TabControl\AdminMenu-Tabs.prereq $($button.Name)"} - $WPFbtnTab1_01.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_01.IsEnabled = $false} Else {$WPFbtnTab1_01.IsEnabled = $true} - $WPFbtnTextTab1_01.Text = $button.Name - $WPFbtnTab1_01.Background = $button.bgcolor - $WPFbtnTab1_01.Foreground = $button.textcolor - #$WPFbtnTab1_01.Add_Click({Call-btnTab1_01}) - $WPFbtnTab1_01.add_Click({ - $ButtonClicked = $WPFbtnTextTab1_01.Text - Call-btnTab1_01 - }) - } - - If ($buttonID -eq "02"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_02.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_02.IsEnabled = $false} Else {$WPFbtnTab1_02.IsEnabled = $true} - $WPFbtnTextTab1_02.Text = $button.Name - $WPFbtnTab1_02.Background = $button.bgcolor - $WPFbtnTab1_02.Foreground = $button.textcolor - $WPFbtnTab1_02.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_02.Text - Call-btnTab1_02 - }) - } - - If ($buttonID -eq "03"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_03.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_03.IsEnabled = $false} Else {$WPFbtnTab1_03.IsEnabled = $true} - $WPFbtnTextTab1_03.Text = $button.Name - $WPFbtnTab1_03.Background = $button.bgcolor - $WPFbtnTab1_03.Foreground = $button.textcolor - $WPFbtnTab1_03.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_03.Text - Call-btnTab1_03 - }) - } - - If ($buttonID -eq "04"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_04.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_04.IsEnabled = $false} Else {$WPFbtnTab1_04.IsEnabled = $true} - $WPFbtnTextTab1_04.Text = $button.Name - $WPFbtnTab1_04.Background = $button.bgcolor - $WPFbtnTab1_04.Foreground = $button.textcolor - $WPFbtnTab1_04.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_04.Text - Call-btnTab1_04 - }) - } - - If ($buttonID -eq "05"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_05.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_05.IsEnabled = $false} Else {$WPFbtnTab1_05.IsEnabled = $true} - $WPFbtnTextTab1_05.Text = $button.Name - $WPFbtnTab1_05.Background = $button.bgcolor - $WPFbtnTab1_05.Foreground = $button.textcolor - $WPFbtnTab1_05.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_05.Text - Call-btnTab1_05 - }) - } - - If ($buttonID -eq "06"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_06.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_06.IsEnabled = $false} Else {$WPFbtnTab1_06.IsEnabled = $true} - $WPFbtnTextTab1_06.Text = $button.Name - $WPFbtnTab1_06.Background = $button.bgcolor - $WPFbtnTab1_06.Foreground = $button.textcolor - $WPFbtnTab1_06.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_06.Text - Call-btnTab1_06 - }) - } - - If ($buttonID -eq "07"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_07.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_07.IsEnabled = $false} Else {$WPFbtnTab1_07.IsEnabled = $true} - $WPFbtnTextTab1_07.Text = $button.Name - $WPFbtnTab1_07.Background = $button.bgcolor - $WPFbtnTab1_07.Foreground = $button.textcolor - $WPFbtnTab1_07.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_07.Text - Call-btnTab1_07 - }) - } - - If ($buttonID -eq "08"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_08.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_08.IsEnabled = $false} Else {$WPFbtnTab1_08.IsEnabled = $true} - $WPFbtnTextTab1_08.Text = $button.Name - $WPFbtnTab1_08.Background = $button.bgcolor - $WPFbtnTab1_08.Foreground = $button.textcolor - $WPFbtnTab1_08.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_08.Text - Call-btnTab1_08 - }) - } - - If ($buttonID -eq "09"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_09.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_09.IsEnabled = $false} Else {$WPFbtnTab1_09.IsEnabled = $true} - $WPFbtnTextTab1_09.Text = $button.Name - $WPFbtnTab1_09.Background = $button.bgcolor - $WPFbtnTab1_09.Foreground = $button.textcolor - $WPFbtnTab1_09.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_09.Text - Call-btnTab1_09 - }) - } - - If ($buttonID -eq "10"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_10.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_10.IsEnabled = $false} Else {$WPFbtnTab1_10.IsEnabled = $true} - $WPFbtnTextTab1_10.Text = $button.Name - $WPFbtnTab1_10.Background = $button.bgcolor - $WPFbtnTab1_10.Foreground = $button.textcolor - $WPFbtnTab1_10.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_10.Text - Call-btnTab1_10 - }) - } - - If ($buttonID -eq "11"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_11.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_11.IsEnabled = $false} Else {$WPFbtnTab1_11.IsEnabled = $true} - $WPFbtnTextTab1_11.Text = $button.Name - $WPFbtnTab1_11.Background = $button.bgcolor - $WPFbtnTab1_11.Foreground = $button.textcolor - $WPFbtnTab1_11.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_11.Text - Call-btnTab1_11 - }) - } - - If ($buttonID -eq "12"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_12.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_12.IsEnabled = $false} Else {$WPFbtnTab1_12.IsEnabled = $true} - $WPFbtnTextTab1_12.Text = $button.Name - $WPFbtnTab1_12.Background = $button.bgcolor - $WPFbtnTab1_12.Foreground = $button.textcolor - $WPFbtnTab1_12.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_12.Text - Call-btnTab1_12 - }) - } - - If ($buttonID -eq "13"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_13.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_13.IsEnabled = $false} Else {$WPFbtnTab1_13.IsEnabled = $true} - $WPFbtnTextTab1_13.Text = $button.Name - $WPFbtnTab1_13.Background = $button.bgcolor - $WPFbtnTab1_13.Foreground = $button.textcolor - $WPFbtnTab1_13.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_13.Text - Call-btnTab1_13 - }) - } - If ($buttonID -eq "14"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_14.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_14.IsEnabled = $false} Else {$WPFbtnTab1_14.IsEnabled = $true} - $WPFbtnTextTab1_14.Text = $button.Name - $WPFbtnTab1_14.Background = $button.bgcolor - $WPFbtnTab1_14.Foreground = $button.textcolor - $WPFbtnTab1_14.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_14.Text - Call-btnTab1_14 - }) - } - - If ($buttonID -eq "15"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_15.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_15.IsEnabled = $false} Else {$WPFbtnTab1_15.IsEnabled = $true} - $WPFbtnTextTab1_15.Text = $button.Name - $WPFbtnTab1_15.Background = $button.bgcolor - $WPFbtnTab1_15.Foreground = $button.textcolor - $WPFbtnTab1_15.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_15.Text - Call-btnTab1_15 - }) - } - - If ($buttonID -eq "16"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_16.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_16.IsEnabled = $false} Else {$WPFbtnTab1_16.IsEnabled = $true} - $WPFbtnTextTab1_16.Text = $button.Name - $WPFbtnTab1_16.Background = $button.bgcolor - $WPFbtnTab1_16.Foreground = $button.textcolor - $WPFbtnTab1_16.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_16.Text - Call-btnTab1_16 - }) - } - - If ($buttonID -eq "17"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_17.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_17.IsEnabled = $false} Else {$WPFbtnTab1_17.IsEnabled = $true} - $WPFbtnTextTab1_17.Text = $button.Name - $WPFbtnTab1_17.Background = $button.bgcolor - $WPFbtnTab1_17.Foreground = $button.textcolor - $WPFbtnTab1_17.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_17.Text - Call-btnTab1_17 - }) - } - - If ($buttonID -eq "18"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_18.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_18.IsEnabled = $false} Else {$WPFbtnTab1_18.IsEnabled = $true} - $WPFbtnTextTab1_18.Text = $button.Name - $WPFbtnTab1_18.Background = $button.bgcolor - $WPFbtnTab1_18.Foreground = $button.textcolor - $WPFbtnTab1_18.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_18.Text - Call-btnTab1_18 - }) - } - - If ($buttonID -eq "19"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_19.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_19.IsEnabled = $false} Else {$WPFbtnTab1_19.IsEnabled = $true} - $WPFbtnTextTab1_19.Text = $button.Name - $WPFbtnTab1_19.Background = $button.bgcolor - $WPFbtnTab1_19.Foreground = $button.textcolor - $WPFbtnTab1_19.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_19.Text - Call-btnTab1_19 - }) - } - - If ($buttonID -eq "20"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_20.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_20.IsEnabled = $false} Else {$WPFbtnTab1_20.IsEnabled = $true} - $WPFbtnTextTab1_20.Text = $button.Name - $WPFbtnTab1_20.Background = $button.bgcolor - $WPFbtnTab1_20.Foreground = $button.textcolor - $WPFbtnTab1_20.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_20.Text - Call-btnTab1_20 - }) - } - - If ($buttonID -eq "21"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_21.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_21.IsEnabled = $false} Else {$WPFbtnTab1_21.IsEnabled = $true} - $WPFbtnTextTab1_21.Text = $button.Name - $WPFbtnTab1_21.Background = $button.bgcolor - $WPFbtnTab1_21.Foreground = $button.textcolor - $WPFbtnTab1_21.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_21.Text - Call-btnTab1_21 - }) - } - - If ($buttonID -eq "22"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_22.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_22.IsEnabled = $false} Else {$WPFbtnTab1_22.IsEnabled = $true} - $WPFbtnTextTab1_22.Text = $button.Name - $WPFbtnTab1_22.Background = $button.bgcolor - $WPFbtnTab1_22.Foreground = $button.textcolor - $WPFbtnTab1_22.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_22.Text - Call-btnTab1_22 - }) - } - - If ($buttonID -eq "23"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_23.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_23.IsEnabled = $false} Else {$WPFbtnTab1_23.IsEnabled = $true} - $WPFbtnTextTab1_23.Text = $button.Name - $WPFbtnTab1_23.Background = $button.bgcolor - $WPFbtnTab1_23.Foreground = $button.textcolor - $WPFbtnTab1_23.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_23.Text - Call-btnTab1_23 - }) - } - - If ($buttonID -eq "24"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_24.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_24.IsEnabled = $false} Else {$WPFbtnTab1_24.IsEnabled = $true} - $WPFbtnTextTab1_24.Text = $button.Name - $WPFbtnTab1_24.Background = $button.bgcolor - $WPFbtnTab1_24.Foreground = $button.textcolor - $WPFbtnTab1_24.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_24.Text - Call-btnTab1_24 - }) - } - - If ($buttonID -eq "25"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_25.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_25.IsEnabled = $false} Else {$WPFbtnTab1_25.IsEnabled = $true} - $WPFbtnTextTab1_25.Text = $button.Name - $WPFbtnTab1_25.Background = $button.bgcolor - $WPFbtnTab1_25.Foreground = $button.textcolor - $WPFbtnTab1_25.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_25.Text - Call-btnTab1_25 - }) - } - - If ($buttonID -eq "26"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab1_26.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab1_26.IsEnabled = $false} Else {$WPFbtnTab1_26.IsEnabled = $true} - $WPFbtnTextTab1_26.Text = $button.Name - $WPFbtnTab1_26.Background = $button.bgcolor - $WPFbtnTab1_26.Foreground = $button.textcolor - $WPFbtnTab1_26.Add_Click({ - $ButtonClicked = $WPFbtnTextTab1_26.Text - Call-btnTab1_26 - }) - } -} +##*============================================= +##* LOAD TAB 2 FROM CONFIG +##*============================================= +$ConfigTab1 = $AppMenuTabandButtons.tab[0] +If ($HashNames.Keys -eq "Tab1"){ + Write-Host "Found Tab2 section in names file" -ForegroundColor Gray + $Tab1HashNames = $HashNames.Tab1 + [string]$Tab1HashList = $Tab1HashNames| out-string -stream + write-Host "`nNames found in list: `n$Tab1HashList" +} +Else{ + Write-Host "No Tab1 section found in names file" -ForegroundColor Gray +} + +$WPFtxtTab1Name1.Text = $envComputerName + +$WPFbtnTab1Name1List.add_Click({Save-ComputerList -TitleDesc "List of Workstations" -TabObject Tab1} ) +##*============================================= +##* FORM ADD CLICK FUNCTIONS +##*============================================= +<# + Examples to use (place in function): + + SIMPLE: + Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal + + SEND TO OUTPUT (PASSTHRU): + Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 + $PasstoOutput = Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String + If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} + + OPEN EXTERNAL PS1 + . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") + + USE INTGRATED FUNCTION (EASIEST) + - to log to output box in tab, use -OutputTab switch + - to identify process alias, use -Alias switch, otherwise the button name will be used + - to specify a custom run message use the -CustomRunMsg switch + - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) + - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch + + EXAMPLE (EXE): + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (EXE) with Parameters: + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab1Name1.Text) -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (PS1): + Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow + +#> +# Set of 6 large buttons under left column +function Call-btnTab1_01{ + Start-ButtonProcess -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal +} + +function Call-btnTab1_02{ + Start-ButtonProcess -Path "$envComSpec" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal +} + +function Call-btnTab1_03{ + If ($WPFtxtTab1Name1.Text -eq $envComputerName){ + Start-ButtonProcess -Path "$envWinDir\system32\compmgmt.msc" -CustomRunMsg "Opening [$ButtonClicked] for local system, change remote system and try again OR right click on local system in the Computer Managmeent window and select 'connect to another computer'." -OutputTab tab1 -WindowStyle Normal + } + Else{ + If (Test-Connection -ComputerName $WPFtxtTab1Name1.Text -Quiet){ + Start-ButtonProcess -Path "$envWinDir\system32\compmgmt.msc" -Parameters ("/computer:" + $WPFtxtTab1Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for: $($WPFtxtTab1Name1.Text)" -Object Tab1 -WindowStyle Normal + } + Else { + Write-OutputBox -OutputBoxMessage "Unable to remotely open [$ButtonClicked] for: $($WPFtxtTab1Name1.Text), system may be offline." -Type "ERROR: " -Object Tab1 + } + } +} + +function Call-btnTab1_04{ + Start-ButtonProcess -Path "$envWinDir\system32\mmc.exe" -OutputTab tab1 -WindowStyle Normal +} + +function Call-btnTab1_05{ + If ($WPFtxtTab1Name1.Text -eq $envComputerName){ + Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked] for local system, change remote system and try again" -Type "ERROR: " -Object Tab1 + } + ElseIf ($Global:SelectedRunAs){ + Start-ButtonProcess -ProcessCall ps1 -File "Connect-Mstsc.ps1" -Parameters "-ComputerName $($WPFtxtTab1Name1.Text)" -OutputTab tab1 -CreateNoWindow + } + Else{ + Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab1Name1.Text) -OutputTab tab1 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab1Name1.Text)" -NeverRunAs -WindowStyle Normal + } +} + +function Call-btnTab1_06{ + +} + +# Set of 4 small buttons under left column +function Call-btnTab1_07{ + #clear Registries last used path + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit" -Name "FindFlags" -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit" -Name "LastKey" -Force -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit" -Name "View" -Force -ErrorAction SilentlyContinue + Start-ButtonProcess -Path "$envWinDir\system32\regedt32.exe" -OutputTab tab1 -WindowStyle Normal +} + +function Call-btnTab1_08{ + $CMToolkitPath = "$envProgramFilesX86\ConfigMgr 2012 Toolkit R2\ClientTools" + $ClassRootValue = (Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\Log.File\shell\open\command" "(Default)" | Select-Object -ExpandProperty "(Default)" -ErrorAction SilentlyContinue).split("%1")[0].Replace('"','').Trim() + If (Test-Path $CMToolkitPath){ + Start-ButtonProcess -Path "$CMToolkitPath\cmtrace.exe" -OutputTab tab1 -WindowStyle Normal + } + ElseIf (Test-Path "$envWinDir\system32\cmtrace.exe"){ + Start-ButtonProcess -Path "$envWinDir\system32\cmtrace.exe" -OutputTab tab1 -WindowStyle Normal + } + ElseIf (Test-Path $ClassRootValue){ + Start-ButtonProcess -Path "$ClassRootValue" -OutputTab tab1 -WindowStyle Normal + } + Else{ + Start-ButtonProcess -Path "$UtilPath\cmtrace.exe" -OutputTab tab1 -WindowStyle Normal + } +} + + +function Call-btnTab1_09{ + If ($WPFtxtTab1Name1.Text -eq $envComputerName){ + Start-ButtonProcess -ProcessCall vbs -Path "BypassCAC.vbs" -OutputTab tab1 -WindowStyle Normal + } + Else{ + Start-ButtonProcess -ProcessCall vbs -Path "BypassCAC.vbs" -Parameters $WPFtxtTab1Name1.Text -WindowStyle Normal + } +} + + +function Call-btnTab1_10{ + +} + + +# Set of 4 large buttons under right column +function Call-btnTab1_11{ + $DameWarePath = "$envProgramFilesX86\DameWare Development\DameWare NT Utilities" + Start-ButtonProcess -Path "$DameWarePath\DNTU.exe" -OutputTab tab1 -WindowStyle Normal -CustomErrMsg "Unable to open [$ButtonClicked], it may not be installed" +} + +function Call-btnTab1_12{ + $DameWarePath = "$envProgramFilesX86\DameWare Development\DameWare NT Utilities" + If ($WPFtxtTab1Name1.Text -eq $envComputerName){ + Start-ButtonProcess -Path "$DameWarePath\DWRCC.exe" -OutputTab tab1 -WindowStyle Normal + } + Else{ + Start-ButtonProcess -Path "$DameWarePath\DWRCC.exe" -Parameters "-m:$($WPFtxtTab1Name1.Text) -u:$Global:runAsAccount -p:$Global:runAsPassword -x:" -CustomRunMsg "Connecting to $($WPFtxtTab1Name1.Text) with [$ButtonClicked]" -OutputTab tab1 -WindowStyle Normal + } + +} + +function Call-btnTab1_13{ + +} + +function Call-btnTab1_14{ + +} + +# Set of 12 small buttons under right column +function Call-btnTab1_15{ + $Pingtest = Test-Connection -ComputerName $WPFtxtTab1Name1.Text -Count 4 | Select Address,IPv4Address,ResponseTime,BufferSize | out-string + Write-OutputBox -OutputBoxMessage "$($WPFtxtTab1Name1.Text) $Pingtest" -Type "PING: " -Object Tab1 + +} + +function Call-btnTab1_16{ + If ($WPFtxtTab1Name1.Text -eq $envComputerName){ + Start-ButtonProcess -ProcessCall cmd -File "systeminfo.exe" -CustomRunMsg "Retrieving [$ButtonClicked] for local system, change remote system and try again." -OutputTab tab1 -CreateNoWindow + } + Else{ + If (Test-Connection -ComputerName $WPFtxtTab1Name1.Text -Quiet){ + Start-ButtonProcess -ProcessCall cmd -File "systeminfo.exe" -Parameters ("/S " + $WPFtxtTab1Name1.Text) -CustomRunMsg "Retrieving [$ButtonClicked] for: $($WPFtxtTab1Name1.Text)" -Object Tab1 -WindowStyle Normal + } + Else { + Write-OutputBox -OutputBoxMessage "Unable to retrieve [$ButtonClicked] for: $($WPFtxtTab1Name1.Text), system may be offline." -Type "ERROR: " -Object Tab1 + } + } +} + +function Call-btnTab1_17{ + #Start-ButtonProcess -ProcessCall ps1 -File "Get-SystemInfo.ps1" -WorkingDirectory "E:\Software\Scripts\AdminMenu\Scripts" -Parameters "-ComputerName PLEXSVR" -OutputTab tab1 -CreateNoWindow + Retrieve-SystemInfo -ComputerName $WPFtxtTab1Name1.Text +} + +function Call-btnTab1_18{ + If ($WPFtxtTab1Name1.Text -eq $envComputerName){ + Start-ButtonProcess -Path "$envWinDir\system32\services.msc" -CustomRunMsg "Opening [$ButtonClicked] for local system, change remote system and try again OR right click on local system in the window and select 'connect to another computer'." -OutputTab tab1 -WindowStyle Normal + } + Else{ + If (Test-Connection -ComputerName $WPFtxtTab1Name1.Text -Quiet){ + Start-ButtonProcess -Path "$envWinDir\system32\services.msc" -Parameters ("/computer:" + $WPFtxtTab1Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for: $($WPFtxtTab1Name1.Text)" -Object Tab1 -WindowStyle Normal + } + Else { + Write-OutputBox -OutputBoxMessage "Unable to remotely open [$ButtonClicked] for: $($WPFtxtTab1Name1.Text), system may be offline." -Type "ERROR: " -Object Tab1 + } + } +} + +function Call-btnTab1_19{ + +} + +function Call-btnTab1_20{ + +} + +function Call-btnTab1_21{ + Get-LoggedIn -computername $WPFtxtTab1Name1.Text -Outbox Tab1 +} + +function Call-btnTab1_22{ + If ($WPFtxtTab1Name1.Text -eq $envComputerName){ + Start-ButtonProcess -Path "$envWinDir\system32\eventvwr.msc" -CustomRunMsg "Opening [$ButtonClicked] for local system, change remote system and try again OR right click on local system in the window and select 'connect to another computer'." -OutputTab tab1 -WindowStyle Normal + } + Else{ + If (Test-Connection -ComputerName $WPFtxtTab1Name1.Text -Quiet){ + Start-ButtonProcess -Path "$envWinDir\system32\seventvwr.msc" -Parameters ("/computer:" + $WPFtxtTab1Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for: $($WPFtxtTab1Name1.Text)" -Object Tab1 -WindowStyle Normal + } + Else { + Write-OutputBox -OutputBoxMessage "Unable to remotely open [$ButtonClicked] for: $($WPFtxtTab1Name1.Text), system may be offline." -Type "ERROR: " -Object Tab1 + } + } + +} + +function Call-btnTab1_23{ + Run-RemoteCMD -ComputerName $WPFtxtTab1Name1.Text -Command $RemoteCommand + Write-OutputBox -OutputBoxMessage "$($WPFtxtTab1Name1.Text) >> sent Remote Command: '$RemoteCommand'" -Type "INFO: " -Object Tab1 +} + +function Call-btnTab1_24{ + Start-ButtonProcess -ProcessCall ps1 -File "Get-DiskSpaceChart.ps1" -Parameters "-ComputerName $($WPFtxtTab1Name1.Text)" -OutputTab tab1 -CreateNoWindow + <#If ($WPFtxtTab1Name1.Text -eq $envComputerName){ + Write-OutputBox -OutputBoxMessage "Retrieving [$ButtonClicked] for local system" -Type "INFO: " -Object Tab1 + Get-WmiObject -Class Win32_LogicalDisk | Out-GridView -Title "Disk Info" + } + Else{ + If (Test-Connection -ComputerName $WPFtxtTab1Name1.Text -Quiet){ + Write-OutputBox -OutputBoxMessage "Retrieving [$ButtonClicked] for [$($WPFtxtTab1Name1.Text)]" -Type "INFO: " -Object Tab1 + Get-WmiObject -Class Win32_LogicalDisk -ComputerName $WPFtxtTab1Name1.Text | Out-GridView -Title "Disk Info" + } + Else { + Write-OutputBox -OutputBoxMessage "Unable to retrieve [$ButtonClicked] for: $($WPFtxtTab1Name1.Text), system may be offline." -Type "ERROR: " -Object Tab1 + } + } + #Get-DiskSpace -computername $WPFtxtTab1Name1.Text #> +} + +function Call-btnTab1_25{ + Get-InstalledSoftware -computername $WPFtxtTab1Name1.Text -Property InstallLocation,UninstallString,QuietUninstallString + #$Script = {Get-InstalledSoftware} + #$Params = @{computername= $WPFtxtTab1Name1.Text; Property = Uninstallstring} + #Start-ButtonProcess -ProcessCall ps1 -File "Invoke-Runspace.ps1" -Parameters "-AddFunction Get-InstalledSoftware -ParamStatic $Params" -WindowStyle Normal + #Invoke-Runspace -ScriptBlock $Script -ParamStatic $Params +} + +function Call-btnTab1_26{ + Start-ButtonProcess -ProcessCall ps1 -File "Remote-TaskMgr.ps1" -Parameters "-ComputerName $($WPFtxtTab1Name1.Text)" -OutputTab tab1 -CreateNoWindow + #. ($scriptRoot + "\Scripts\Remote-TaskMgr.ps1") $WPFtxtTab1Name1.Text + #Build-TskMgrForm -Remote $WPFtxtTab1Name1.Text +} + + +##*============================================= +##* TAB 1 OTHER FUNCTIONS +##*============================================= + + + + +##*============================================= +##* BUILD TAB 1 BUTTONS IF CONFIGURED +##*============================================= +$ConfigTab1_Name = $ConfigTab1.Name + +$WPFTab1.Header = $ConfigTab1_Name +$WPFlblTab1Section1.Content = $ConfigTab1.section1Label +$WPFlblTab1Section2.Content = $ConfigTab1.section2Label + + +$ConfigTab1_btns = $ConfigTab1.button + +Foreach ($button in $ConfigTab1_btns){ + + [string]$buttonID = $button.id + If ($AppOptionDebugeMode){Write-Host "Tab1: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} + + If ($buttonID -eq "01"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_01.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_01.IsEnabled = $false} Else {$WPFbtnTab1_01.IsEnabled = $true} + $WPFbtnTextTab1_01.Text = $button.Name + $WPFbtnTab1_01.Background = $button.bgcolor + $WPFbtnTab1_01.Foreground = $button.textcolor + #$WPFbtnTab1_01.Add_Click({Call-btnTab1_01}) + $WPFbtnTab1_01.add_Click({ + $ButtonClicked = $WPFbtnTextTab1_01.Text + Call-btnTab1_01 + }) + } + + If ($buttonID -eq "02"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_02.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_02.IsEnabled = $false} Else {$WPFbtnTab1_02.IsEnabled = $true} + $WPFbtnTextTab1_02.Text = $button.Name + $WPFbtnTab1_02.Background = $button.bgcolor + $WPFbtnTab1_02.Foreground = $button.textcolor + $WPFbtnTab1_02.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_02.Text + Call-btnTab1_02 + }) + } + + If ($buttonID -eq "03"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_03.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_03.IsEnabled = $false} Else {$WPFbtnTab1_03.IsEnabled = $true} + $WPFbtnTextTab1_03.Text = $button.Name + $WPFbtnTab1_03.Background = $button.bgcolor + $WPFbtnTab1_03.Foreground = $button.textcolor + $WPFbtnTab1_03.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_03.Text + Call-btnTab1_03 + }) + } + + If ($buttonID -eq "04"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_04.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_04.IsEnabled = $false} Else {$WPFbtnTab1_04.IsEnabled = $true} + $WPFbtnTextTab1_04.Text = $button.Name + $WPFbtnTab1_04.Background = $button.bgcolor + $WPFbtnTab1_04.Foreground = $button.textcolor + $WPFbtnTab1_04.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_04.Text + Call-btnTab1_04 + }) + } + + If ($buttonID -eq "05"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_05.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_05.IsEnabled = $false} Else {$WPFbtnTab1_05.IsEnabled = $true} + $WPFbtnTextTab1_05.Text = $button.Name + $WPFbtnTab1_05.Background = $button.bgcolor + $WPFbtnTab1_05.Foreground = $button.textcolor + $WPFbtnTab1_05.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_05.Text + Call-btnTab1_05 + }) + } + + If ($buttonID -eq "06"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_06.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_06.IsEnabled = $false} Else {$WPFbtnTab1_06.IsEnabled = $true} + $WPFbtnTextTab1_06.Text = $button.Name + $WPFbtnTab1_06.Background = $button.bgcolor + $WPFbtnTab1_06.Foreground = $button.textcolor + $WPFbtnTab1_06.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_06.Text + Call-btnTab1_06 + }) + } + + If ($buttonID -eq "07"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_07.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_07.IsEnabled = $false} Else {$WPFbtnTab1_07.IsEnabled = $true} + $WPFbtnTextTab1_07.Text = $button.Name + $WPFbtnTab1_07.Background = $button.bgcolor + $WPFbtnTab1_07.Foreground = $button.textcolor + $WPFbtnTab1_07.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_07.Text + Call-btnTab1_07 + }) + } + + If ($buttonID -eq "08"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_08.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_08.IsEnabled = $false} Else {$WPFbtnTab1_08.IsEnabled = $true} + $WPFbtnTextTab1_08.Text = $button.Name + $WPFbtnTab1_08.Background = $button.bgcolor + $WPFbtnTab1_08.Foreground = $button.textcolor + $WPFbtnTab1_08.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_08.Text + Call-btnTab1_08 + }) + } + + If ($buttonID -eq "09"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_09.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_09.IsEnabled = $false} Else {$WPFbtnTab1_09.IsEnabled = $true} + $WPFbtnTextTab1_09.Text = $button.Name + $WPFbtnTab1_09.Background = $button.bgcolor + $WPFbtnTab1_09.Foreground = $button.textcolor + $WPFbtnTab1_09.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_09.Text + Call-btnTab1_09 + }) + } + + If ($buttonID -eq "10"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_10.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_10.IsEnabled = $false} Else {$WPFbtnTab1_10.IsEnabled = $true} + $WPFbtnTextTab1_10.Text = $button.Name + $WPFbtnTab1_10.Background = $button.bgcolor + $WPFbtnTab1_10.Foreground = $button.textcolor + $WPFbtnTab1_10.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_10.Text + Call-btnTab1_10 + }) + } + + If ($buttonID -eq "11"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_11.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_11.IsEnabled = $false} Else {$WPFbtnTab1_11.IsEnabled = $true} + $WPFbtnTextTab1_11.Text = $button.Name + $WPFbtnTab1_11.Background = $button.bgcolor + $WPFbtnTab1_11.Foreground = $button.textcolor + $WPFbtnTab1_11.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_11.Text + Call-btnTab1_11 + }) + } + + If ($buttonID -eq "12"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_12.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_12.IsEnabled = $false} Else {$WPFbtnTab1_12.IsEnabled = $true} + $WPFbtnTextTab1_12.Text = $button.Name + $WPFbtnTab1_12.Background = $button.bgcolor + $WPFbtnTab1_12.Foreground = $button.textcolor + $WPFbtnTab1_12.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_12.Text + Call-btnTab1_12 + }) + } + + If ($buttonID -eq "13"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_13.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_13.IsEnabled = $false} Else {$WPFbtnTab1_13.IsEnabled = $true} + $WPFbtnTextTab1_13.Text = $button.Name + $WPFbtnTab1_13.Background = $button.bgcolor + $WPFbtnTab1_13.Foreground = $button.textcolor + $WPFbtnTab1_13.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_13.Text + Call-btnTab1_13 + }) + } + If ($buttonID -eq "14"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_14.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_14.IsEnabled = $false} Else {$WPFbtnTab1_14.IsEnabled = $true} + $WPFbtnTextTab1_14.Text = $button.Name + $WPFbtnTab1_14.Background = $button.bgcolor + $WPFbtnTab1_14.Foreground = $button.textcolor + $WPFbtnTab1_14.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_14.Text + Call-btnTab1_14 + }) + } + + If ($buttonID -eq "15"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_15.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_15.IsEnabled = $false} Else {$WPFbtnTab1_15.IsEnabled = $true} + $WPFbtnTextTab1_15.Text = $button.Name + $WPFbtnTab1_15.Background = $button.bgcolor + $WPFbtnTab1_15.Foreground = $button.textcolor + $WPFbtnTab1_15.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_15.Text + Call-btnTab1_15 + }) + } + + If ($buttonID -eq "16"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_16.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_16.IsEnabled = $false} Else {$WPFbtnTab1_16.IsEnabled = $true} + $WPFbtnTextTab1_16.Text = $button.Name + $WPFbtnTab1_16.Background = $button.bgcolor + $WPFbtnTab1_16.Foreground = $button.textcolor + $WPFbtnTab1_16.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_16.Text + Call-btnTab1_16 + }) + } + + If ($buttonID -eq "17"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_17.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_17.IsEnabled = $false} Else {$WPFbtnTab1_17.IsEnabled = $true} + $WPFbtnTextTab1_17.Text = $button.Name + $WPFbtnTab1_17.Background = $button.bgcolor + $WPFbtnTab1_17.Foreground = $button.textcolor + $WPFbtnTab1_17.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_17.Text + Call-btnTab1_17 + }) + } + + If ($buttonID -eq "18"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_18.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_18.IsEnabled = $false} Else {$WPFbtnTab1_18.IsEnabled = $true} + $WPFbtnTextTab1_18.Text = $button.Name + $WPFbtnTab1_18.Background = $button.bgcolor + $WPFbtnTab1_18.Foreground = $button.textcolor + $WPFbtnTab1_18.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_18.Text + Call-btnTab1_18 + }) + } + + If ($buttonID -eq "19"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_19.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_19.IsEnabled = $false} Else {$WPFbtnTab1_19.IsEnabled = $true} + $WPFbtnTextTab1_19.Text = $button.Name + $WPFbtnTab1_19.Background = $button.bgcolor + $WPFbtnTab1_19.Foreground = $button.textcolor + $WPFbtnTab1_19.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_19.Text + Call-btnTab1_19 + }) + } + + If ($buttonID -eq "20"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_20.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_20.IsEnabled = $false} Else {$WPFbtnTab1_20.IsEnabled = $true} + $WPFbtnTextTab1_20.Text = $button.Name + $WPFbtnTab1_20.Background = $button.bgcolor + $WPFbtnTab1_20.Foreground = $button.textcolor + $WPFbtnTab1_20.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_20.Text + Call-btnTab1_20 + }) + } + + If ($buttonID -eq "21"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_21.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_21.IsEnabled = $false} Else {$WPFbtnTab1_21.IsEnabled = $true} + $WPFbtnTextTab1_21.Text = $button.Name + $WPFbtnTab1_21.Background = $button.bgcolor + $WPFbtnTab1_21.Foreground = $button.textcolor + $WPFbtnTab1_21.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_21.Text + Call-btnTab1_21 + }) + } + + If ($buttonID -eq "22"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_22.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_22.IsEnabled = $false} Else {$WPFbtnTab1_22.IsEnabled = $true} + $WPFbtnTextTab1_22.Text = $button.Name + $WPFbtnTab1_22.Background = $button.bgcolor + $WPFbtnTab1_22.Foreground = $button.textcolor + $WPFbtnTab1_22.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_22.Text + Call-btnTab1_22 + }) + } + + If ($buttonID -eq "23"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_23.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_23.IsEnabled = $false} Else {$WPFbtnTab1_23.IsEnabled = $true} + $WPFbtnTextTab1_23.Text = $button.Name + $WPFbtnTab1_23.Background = $button.bgcolor + $WPFbtnTab1_23.Foreground = $button.textcolor + $WPFbtnTab1_23.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_23.Text + Call-btnTab1_23 + }) + } + + If ($buttonID -eq "24"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_24.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_24.IsEnabled = $false} Else {$WPFbtnTab1_24.IsEnabled = $true} + $WPFbtnTextTab1_24.Text = $button.Name + $WPFbtnTab1_24.Background = $button.bgcolor + $WPFbtnTab1_24.Foreground = $button.textcolor + $WPFbtnTab1_24.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_24.Text + Call-btnTab1_24 + }) + } + + If ($buttonID -eq "25"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_25.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_25.IsEnabled = $false} Else {$WPFbtnTab1_25.IsEnabled = $true} + $WPFbtnTextTab1_25.Text = $button.Name + $WPFbtnTab1_25.Background = $button.bgcolor + $WPFbtnTab1_25.Foreground = $button.textcolor + $WPFbtnTab1_25.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_25.Text + Call-btnTab1_25 + }) + } + + If ($buttonID -eq "26"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab1_26.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab1_26.IsEnabled = $false} Else {$WPFbtnTab1_26.IsEnabled = $true} + $WPFbtnTextTab1_26.Text = $button.Name + $WPFbtnTab1_26.Background = $button.bgcolor + $WPFbtnTab1_26.Foreground = $button.textcolor + $WPFbtnTab1_26.Add_Click({ + $ButtonClicked = $WPFbtnTextTab1_26.Text + Call-btnTab1_26 + }) + } +} diff --git a/App/Extensions/TabControl/AdminMenu-Tab2.ps1 b/Extensions/TabControl/AdminMenu-Tab2.ps1 similarity index 96% rename from App/Extensions/TabControl/AdminMenu-Tab2.ps1 rename to Extensions/TabControl/AdminMenu-Tab2.ps1 index 6db4e5b..531dbd4 100644 --- a/App/Extensions/TabControl/AdminMenu-Tab2.ps1 +++ b/Extensions/TabControl/AdminMenu-Tab2.ps1 @@ -1,595 +1,595 @@ -##*============================================= -##* LOAD TAB 2 FROM CONFIG -##*============================================= -$ConfigTab2 = $AppMenuTabandButtons.tab[1] -If ($HashNames.Keys -eq "Tab2"){ - Write-Host "Found Tab2 section in Names File" -ForegroundColor Gray - $Tab2HashNames = $HashNames.Tab2 - [string]$Tab2HashList = $Tab2HashNames| out-string -stream - write-Host "`nNames found in list: `n$Tab2HashList" -} -Else{ - Write-Host "No Tab2 section found in names file" -ForegroundColor Gray -} - -If($IsMachinePartOfDomain){$WPFtxtTab2Name1.Text = $envMachineADDomain}Else{$WPFtxtTab2Name1.Text = $envComputerName} - -$WPFbtnTab2Name2List.add_Click({Save-ComputerList -TitleDesc "List of Domain Controllers" -TabObject Tab2}) -##*============================================= -##* FORM ADD CLICK FUNCTIONS -##*============================================= -<# - Examples to use (place in function): - - SIMPLE: - Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal - - SEND TO OUTPUT (PASSTHRU): - Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 - $PasstoOutput = Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String - If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} - - OPEN EXTERNAL PS1 - . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") - - USE INTGRATED FUNCTION (EASIEST) - - to log to output box in tab, use -OutputTab switch - - to identify process alias, use -Alias switch, otherwise path will be used instead - - to specify a custom run message use the -CustomRunMsg switch - - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) - - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch - - EXAMPLE (EXE): - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (EXE) with Parameters: - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (PS1): - Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow - -#> -# Set of 6 large buttons under left column -function Call-btnTab2_01{ - $ADMSC = "$envWinDir\system32\dsa.msc" - If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ - If ($WPFtxtTab2Name2.Text){ - Start-ButtonProcess -Path "$ADMSC" -Parameters ("/server=" + $WPFtxtTab2Name2.Text) -CustomRunMsg "Opening [$ButtonClicked] on DC: $($WPFtxtTab2Name2.Text)" -OutputTab Tab2 -WindowStyle Normal - } - ElseIf($WPFtxtTab2Name1.Text){ - Start-ButtonProcess -Path "$ADMSC" -Parameters ("/domain=" + $WPFtxtTab2Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for Domain: $($WPFtxtTab2Name1.Text)" -OutputTab Tab2 -WindowStyle Normal - } - Else{ - Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal - } - } - Else{ - Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 - } -} - -function Call-btnTab2_02{ - $ADMSC = "$envWinDir\system32\dssite.msc" - If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ - If ($WPFtxtTab2Name1.Text){ - Start-ButtonProcess -Path "$ADMSC" -Parameters ("/domain=" + $WPFtxtTab2Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for: $($WPFtxtTab2Name1.Text)" -OutputTab Tab2 -WindowStyle Normal - } - Else{ - Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal - } - } - Else{ - Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 - } -} - -function Call-btnTab2_03{ - $ADMSC = "$envWinDir\system32\gpmc.msc" - If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ - If ($WPFtxtTab2Name2.Text){ - Start-ButtonProcess -Path "$ADMSC" -Parameters ("/server=" + $WPFtxtTab2Name2.Text) -CustomRunMsg "Opening [$ButtonClicked] on DC: $($WPFtxtTab2Name2.Text)" -OutputTab Tab2 -WindowStyle Normal - } - ElseIf ($WPFtxtTab2Name1.Text){ - Start-ButtonProcess -Path "$ADMSC" -Parameters ("/domain=" + $WPFtxtTab2Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for Domain: $($WPFtxtTab2Name1.Text)" -OutputTab Tab2 -WindowStyle Normal - } - Else{ - Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal - } - } - Else{ - Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 - } -} - -function Call-btnTab2_04{ - -} - -function Call-btnTab2_05{ - -} - -function Call-btnTab2_06{ - -} - -# Set of 4 small buttons under left column -function Call-btnTab2_07{ - -} - -function Call-btnTab2_08{ - $ADMSC = "$envWinDir\system32\dnsmgmt.msc" - If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ - If ($WPFtxtTab2Name2.Text){ - Start-ButtonProcess -Path "$ADMSC" -Parameters ("/ComputerName " + $WPFtxtTab2Name2.Text) -CustomRunMsg "Opening [$ButtonClicked] on DNS Server: $($WPFtxtTab2Name2.Text)" -OutputTab Tab2 -WindowStyle Normal - } - ElseIf ($WPFtxtTab2Name1.Text){ - Start-ButtonProcess -Path "$ADMSC" -Parameters ("/ComputerName " + $WPFtxtTab2Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for Domain: $($WPFtxtTab2Name1.Text)" -OutputTab Tab2 -WindowStyle Normal - } - Else{ - Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal - } - } - Else{ - Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 - } -} - - -function Call-btnTab2_09{ - $ADMSC = "$envWinDir\system32\dhcpmgmt.msc" - If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ - If ($WPFtxtTab2Name2.Text){ - Start-ButtonProcess -Path "$ADMSC" -Parameters ("/ComputerName " + $WPFtxtTab2Name2.Text) -CustomRunMsg "Opening [$ButtonClicked] on DHCP Server: $($WPFtxtTab2Name2.Text)" -OutputTab Tab2 -WindowStyle Normal - } - Else{ - Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal - } - } - Else{ - Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 - } -} - - -function Call-btnTab2_10{ - -} - - -# Set of 4 large buttons under right columnl -function Call-btnTab2_11{ - Start-ButtonProcess -ProcessCall module -Path ActiveDirectory -OutputTab Tab2 -WindowStyle Normal -} - -function Call-btnTab2_12{ -} - -function Call-btnTab2_13{ - -} - -function Call-btnTab2_14{ - -} - -# Set of 12 small buttons under right column -function Call-btnTab2_15{ - Start-ButtonProcess -Path "$envWinDir\system32\ServerManager.exe" -OutputTab Tab2 -WindowStyle Normal -} - -function Call-btnTab2_16{ - -} - -function Call-btnTab2_17{ - -} - -function Call-btnTab2_18{ - If ($Global:SelectedRunAs){ - Start-ButtonProcess -ProcessCall ps1 -File "Connect-Mstsc.ps1" -Parameters "-ComputerName $($WPFtxtTab2Name2.Text)" -OutputTab tab2 -CreateNoWindow - } - Else{ - Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab2Name2.Text) -OutputTab tab2 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab2Name2.Text)" -NeverRunAs -WindowStyle Normal - } -} - -function Call-btnTab2_19{ -} - -function Call-btnTab2_20{ - -} - -function Call-btnTab2_21{ - -} - -function Call-btnTab2_22{ - -} - - -function Call-btnTab2_23{ - -} - -function Call-btnTab2_24{ - -} - -function Call-btnTab2_25{ - -} - -function Call-btnTab2_26{ - -} - - -##*============================================= -##* TAB 2 FUNCTIONS -##*============================================= - - - - -##*============================================= -##* BUILD TAB 2 BUTTONS IF CONFIGURED -##*============================================= -$ConfigTab2_Name = $ConfigTab2.Name - -$WPFTab2.Header = $ConfigTab2_Name -$WPFlblTab2Section1.Content = $ConfigTab2.section1Label -$WPFlblTab2Section2.Content = $ConfigTab2.section2Label - -$ConfigTab2_btns = $ConfigTab2.button - - -Foreach ($button in $ConfigTab2_btns){ - - [string]$buttonID = $button.id - If ($AppOptionDebugeMode){Write-Host "Tab2: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} - - If ($buttonID -eq "01"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_01.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_01.IsEnabled = $false} Else {$WPFbtnTab2_01.IsEnabled = $true} - $WPFbtnTextTab2_01.Text = $button.Name - $WPFbtnTab2_01.Background = $button.bgcolor - $WPFbtnTab2_01.Foreground = $button.textcolor - #$WPFbtnTab2_01.Add_Click({Call-btnTab2_01}) - $WPFbtnTab2_01.add_Click({ - $ButtonClicked = $WPFbtnTextTab2_01.Text - Call-btnTab2_01 - }) - } - - If ($buttonID -eq "02"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_02.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_02.IsEnabled = $false} Else {$WPFbtnTab2_02.IsEnabled = $true} - $WPFbtnTextTab2_02.Text = $button.Name - $WPFbtnTab2_02.Background = $button.bgcolor - $WPFbtnTab2_02.Foreground = $button.textcolor - $WPFbtnTab2_02.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_02.Text - Call-btnTab2_02 - }) - } - - If ($buttonID -eq "03"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_03.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_03.IsEnabled = $false} Else {$WPFbtnTab2_03.IsEnabled = $true} - $WPFbtnTextTab2_03.Text = $button.Name - $WPFbtnTab2_03.Background = $button.bgcolor - $WPFbtnTab2_03.Foreground = $button.textcolor - $WPFbtnTab2_03.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_03.Text - Call-btnTab2_03 - }) - } - - If ($buttonID -eq "04"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_04.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_04.IsEnabled = $false} Else {$WPFbtnTab2_04.IsEnabled = $true} - $WPFbtnTextTab2_04.Text = $button.Name - $WPFbtnTab2_04.Background = $button.bgcolor - $WPFbtnTab2_04.Foreground = $button.textcolor - $WPFbtnTab2_04.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_04.Text - Call-btnTab2_04 - }) - } - - If ($buttonID -eq "05"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_05.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_05.IsEnabled = $false} Else {$WPFbtnTab2_05.IsEnabled = $true} - $WPFbtnTextTab2_05.Text = $button.Name - $WPFbtnTab2_05.Background = $button.bgcolor - $WPFbtnTab2_05.Foreground = $button.textcolor - $WPFbtnTab2_05.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_05.Text - Call-btnTab2_05 - }) - } - - If ($buttonID -eq "06"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_06.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_06.IsEnabled = $false} Else {$WPFbtnTab2_06.IsEnabled = $true} - $WPFbtnTextTab2_06.Text = $button.Name - $WPFbtnTab2_06.Background = $button.bgcolor - $WPFbtnTab2_06.Foreground = $button.textcolor - $WPFbtnTab2_06.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_06.Text - Call-btnTab2_06 - }) - } - - If ($buttonID -eq "07"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_07.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_07.IsEnabled = $false} Else {$WPFbtnTab2_07.IsEnabled = $true} - $WPFbtnTextTab2_07.Text = $button.Name - $WPFbtnTab2_07.Background = $button.bgcolor - $WPFbtnTab2_07.Foreground = $button.textcolor - $WPFbtnTab2_07.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_07.Text - Call-btnTab2_07 - }) - } - - If ($buttonID -eq "08"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_08.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_08.IsEnabled = $false} Else {$WPFbtnTab2_08.IsEnabled = $true} - $WPFbtnTextTab2_08.Text = $button.Name - $WPFbtnTab2_08.Background = $button.bgcolor - $WPFbtnTab2_08.Foreground = $button.textcolor - $WPFbtnTab2_08.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_08.Text - Call-btnTab2_08 - }) - } - - If ($buttonID -eq "09"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_09.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_09.IsEnabled = $false} Else {$WPFbtnTab2_09.IsEnabled = $true} - $WPFbtnTextTab2_09.Text = $button.Name - $WPFbtnTab2_09.Background = $button.bgcolor - $WPFbtnTab2_09.Foreground = $button.textcolor - $WPFbtnTab2_09.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_09.Text - Call-btnTab2_09 - }) - } - - If ($buttonID -eq "10"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_10.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_10.IsEnabled = $false} Else {$WPFbtnTab2_10.IsEnabled = $true} - $WPFbtnTextTab2_10.Text = $button.Name - $WPFbtnTab2_10.Background = $button.bgcolor - $WPFbtnTab2_10.Foreground = $button.textcolor - $WPFbtnTab2_10.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_10.Text - Call-btnTab2_10 - }) - } - - If ($buttonID -eq "11"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_11.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_11.IsEnabled = $false} Else {$WPFbtnTab2_11.IsEnabled = $true} - $WPFbtnTextTab2_11.Text = $button.Name - $WPFbtnTab2_11.Background = $button.bgcolor - $WPFbtnTab2_11.Foreground = $button.textcolor - $WPFbtnTab2_11.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_11.Text - Call-btnTab2_11 - }) - } - - If ($buttonID -eq "12"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_12.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_12.IsEnabled = $false} Else {$WPFbtnTab2_12.IsEnabled = $true} - $WPFbtnTextTab2_12.Text = $button.Name - $WPFbtnTab2_12.Background = $button.bgcolor - $WPFbtnTab2_12.Foreground = $button.textcolor - $WPFbtnTab2_12.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_12.Text - Call-btnTab2_12 - }) - } - - If ($buttonID -eq "13"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_13.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_13.IsEnabled = $false} Else {$WPFbtnTab2_13.IsEnabled = $true} - $WPFbtnTextTab2_13.Text = $button.Name - $WPFbtnTab2_13.Background = $button.bgcolor - $WPFbtnTab2_13.Foreground = $button.textcolor - $WPFbtnTab2_13.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_13.Text - Call-btnTab2_13 - }) - } - If ($buttonID -eq "14"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_14.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_14.IsEnabled = $false} Else {$WPFbtnTab2_14.IsEnabled = $true} - $WPFbtnTextTab2_14.Text = $button.Name - $WPFbtnTab2_14.Background = $button.bgcolor - $WPFbtnTab2_14.Foreground = $button.textcolor - $WPFbtnTab2_14.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_14.Text - Call-btnTab2_14 - }) - } - - If ($buttonID -eq "15"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_15.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_15.IsEnabled = $false} Else {$WPFbtnTab2_15.IsEnabled = $true} - $WPFbtnTextTab2_15.Text = $button.Name - $WPFbtnTab2_15.Background = $button.bgcolor - $WPFbtnTab2_15.Foreground = $button.textcolor - $WPFbtnTab2_15.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_15.Text - Call-btnTab2_15 - }) - } - - If ($buttonID -eq "16"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_16.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_16.IsEnabled = $false} Else {$WPFbtnTab2_16.IsEnabled = $true} - $WPFbtnTextTab2_16.Text = $button.Name - $WPFbtnTab2_16.Background = $button.bgcolor - $WPFbtnTab2_16.Foreground = $button.textcolor - $WPFbtnTab2_16.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_16.Text - Call-btnTab2_16 - }) - } - - If ($buttonID -eq "17"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_17.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_17.IsEnabled = $false} Else {$WPFbtnTab2_17.IsEnabled = $true} - $WPFbtnTextTab2_17.Text = $button.Name - $WPFbtnTab2_17.Background = $button.bgcolor - $WPFbtnTab2_17.Foreground = $button.textcolor - $WPFbtnTab2_17.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_17.Text - Call-btnTab2_17 - }) - } - - If ($buttonID -eq "18"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_18.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_18.IsEnabled = $false} Else {$WPFbtnTab2_18.IsEnabled = $true} - $WPFbtnTextTab2_18.Text = $button.Name - $WPFbtnTab2_18.Background = $button.bgcolor - $WPFbtnTab2_18.Foreground = $button.textcolor - $WPFbtnTab2_18.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_18.Text - Call-btnTab2_18 - }) - } - - If ($buttonID -eq "19"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_19.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_19.IsEnabled = $false} Else {$WPFbtnTab2_19.IsEnabled = $true} - $WPFbtnTextTab2_19.Text = $button.Name - $WPFbtnTab2_19.Background = $button.bgcolor - $WPFbtnTab2_19.Foreground = $button.textcolor - $WPFbtnTab2_19.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_19.Text - Call-btnTab2_19 - }) - } - - If ($buttonID -eq "20"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_20.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_20.IsEnabled = $false} Else {$WPFbtnTab2_20.IsEnabled = $true} - $WPFbtnTextTab2_20.Text = $button.Name - $WPFbtnTab2_20.Background = $button.bgcolor - $WPFbtnTab2_20.Foreground = $button.textcolor - $WPFbtnTab2_20.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_20.Text - Call-btnTab2_20 - }) - } - - If ($buttonID -eq "21"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_21.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_21.IsEnabled = $false} Else {$WPFbtnTab2_21.IsEnabled = $true} - $WPFbtnTextTab2_21.Text = $button.Name - $WPFbtnTab2_21.Background = $button.bgcolor - $WPFbtnTab2_21.Foreground = $button.textcolor - $WPFbtnTab2_21.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_21.Text - Call-btnTab2_21 - }) - } - - If ($buttonID -eq "22"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_22.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_22.IsEnabled = $false} Else {$WPFbtnTab2_22.IsEnabled = $true} - $WPFbtnTextTab2_22.Text = $button.Name - $WPFbtnTab2_22.Background = $button.bgcolor - $WPFbtnTab2_22.Foreground = $button.textcolor - $WPFbtnTab2_22.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_22.Text - Call-btnTab2_22 - }) - } - - If ($buttonID -eq "23"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_23.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_23.IsEnabled = $false} Else {$WPFbtnTab2_23.IsEnabled = $true} - $WPFbtnTextTab2_23.Text = $button.Name - $WPFbtnTab2_23.Background = $button.bgcolor - $WPFbtnTab2_23.Foreground = $button.textcolor - $WPFbtnTab2_23.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_23.Text - Call-btnTab2_23 - }) - } - - If ($buttonID -eq "24"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_24.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_24.IsEnabled = $false} Else {$WPFbtnTab2_24.IsEnabled = $true} - $WPFbtnTextTab2_24.Text = $button.Name - $WPFbtnTab2_24.Background = $button.bgcolor - $WPFbtnTab2_24.Foreground = $button.textcolor - $WPFbtnTab2_24.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_24.Text - Call-btnTab2_24 - }) - } - - If ($buttonID -eq "25"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_25.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_25.IsEnabled = $false} Else {$WPFbtnTab2_25.IsEnabled = $true} - $WPFbtnTextTab2_25.Text = $button.Name - $WPFbtnTab2_25.Background = $button.bgcolor - $WPFbtnTab2_25.Foreground = $button.textcolor - $WPFbtnTab2_25.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_25.Text - Call-btnTab2_25 - }) - } - - If ($buttonID -eq "26"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab2_26.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab2_26.IsEnabled = $false} Else {$WPFbtnTab2_26.IsEnabled = $true} - $WPFbtnTextTab2_26.Text = $button.Name - $WPFbtnTab2_26.Background = $button.bgcolor - $WPFbtnTab2_26.Foreground = $button.textcolor - $WPFbtnTab2_26.Add_Click({ - $ButtonClicked = $WPFbtnTextTab2_26.Text - Call-btnTab2_26 - }) - } - -} +##*============================================= +##* LOAD TAB 2 FROM CONFIG +##*============================================= +$ConfigTab2 = $AppMenuTabandButtons.tab[1] +If ($HashNames.Keys -eq "Tab2"){ + Write-Host "Found Tab2 section in Names File" -ForegroundColor Gray + $Tab2HashNames = $HashNames.Tab2 + [string]$Tab2HashList = $Tab2HashNames| out-string -stream + write-Host "`nNames found in list: `n$Tab2HashList" +} +Else{ + Write-Host "No Tab2 section found in names file" -ForegroundColor Gray +} + +If($IsMachinePartOfDomain){$WPFtxtTab2Name1.Text = $envMachineADDomain}Else{$WPFtxtTab2Name1.Text = $envComputerName} + +$WPFbtnTab2Name2List.add_Click({Save-ComputerList -TitleDesc "List of Domain Controllers" -TabObject Tab2}) +##*============================================= +##* FORM ADD CLICK FUNCTIONS +##*============================================= +<# + Examples to use (place in function): + + SIMPLE: + Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal + + SEND TO OUTPUT (PASSTHRU): + Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 + $PasstoOutput = Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String + If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} + + OPEN EXTERNAL PS1 + . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") + + USE INTGRATED FUNCTION (EASIEST) + - to log to output box in tab, use -OutputTab switch + - to identify process alias, use -Alias switch, otherwise path will be used instead + - to specify a custom run message use the -CustomRunMsg switch + - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) + - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch + + EXAMPLE (EXE): + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (EXE) with Parameters: + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (PS1): + Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow + +#> +# Set of 6 large buttons under left column +function Call-btnTab2_01{ + $ADMSC = "$envWinDir\system32\dsa.msc" + If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ + If ($WPFtxtTab2Name2.Text){ + Start-ButtonProcess -Path "$ADMSC" -Parameters ("/server=" + $WPFtxtTab2Name2.Text) -CustomRunMsg "Opening [$ButtonClicked] on DC: $($WPFtxtTab2Name2.Text)" -OutputTab Tab2 -WindowStyle Normal + } + ElseIf($WPFtxtTab2Name1.Text){ + Start-ButtonProcess -Path "$ADMSC" -Parameters ("/domain=" + $WPFtxtTab2Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for Domain: $($WPFtxtTab2Name1.Text)" -OutputTab Tab2 -WindowStyle Normal + } + Else{ + Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal + } + } + Else{ + Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 + } +} + +function Call-btnTab2_02{ + $ADMSC = "$envWinDir\system32\dssite.msc" + If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ + If ($WPFtxtTab2Name1.Text){ + Start-ButtonProcess -Path "$ADMSC" -Parameters ("/domain=" + $WPFtxtTab2Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for: $($WPFtxtTab2Name1.Text)" -OutputTab Tab2 -WindowStyle Normal + } + Else{ + Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal + } + } + Else{ + Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 + } +} + +function Call-btnTab2_03{ + $ADMSC = "$envWinDir\system32\gpmc.msc" + If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ + If ($WPFtxtTab2Name2.Text){ + Start-ButtonProcess -Path "$ADMSC" -Parameters ("/server=" + $WPFtxtTab2Name2.Text) -CustomRunMsg "Opening [$ButtonClicked] on DC: $($WPFtxtTab2Name2.Text)" -OutputTab Tab2 -WindowStyle Normal + } + ElseIf ($WPFtxtTab2Name1.Text){ + Start-ButtonProcess -Path "$ADMSC" -Parameters ("/domain=" + $WPFtxtTab2Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for Domain: $($WPFtxtTab2Name1.Text)" -OutputTab Tab2 -WindowStyle Normal + } + Else{ + Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal + } + } + Else{ + Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 + } +} + +function Call-btnTab2_04{ + +} + +function Call-btnTab2_05{ + +} + +function Call-btnTab2_06{ + +} + +# Set of 4 small buttons under left column +function Call-btnTab2_07{ + +} + +function Call-btnTab2_08{ + $ADMSC = "$envWinDir\system32\dnsmgmt.msc" + If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ + If ($WPFtxtTab2Name2.Text){ + Start-ButtonProcess -Path "$ADMSC" -Parameters ("/ComputerName " + $WPFtxtTab2Name2.Text) -CustomRunMsg "Opening [$ButtonClicked] on DNS Server: $($WPFtxtTab2Name2.Text)" -OutputTab Tab2 -WindowStyle Normal + } + ElseIf ($WPFtxtTab2Name1.Text){ + Start-ButtonProcess -Path "$ADMSC" -Parameters ("/ComputerName " + $WPFtxtTab2Name1.Text) -CustomRunMsg "Opening [$ButtonClicked] for Domain: $($WPFtxtTab2Name1.Text)" -OutputTab Tab2 -WindowStyle Normal + } + Else{ + Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal + } + } + Else{ + Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 + } +} + + +function Call-btnTab2_09{ + $ADMSC = "$envWinDir\system32\dhcpmgmt.msc" + If (($AppOptionRSATCheck) -and ($WPFtxtRSAT.Text -eq 'Yes') -or (!$AppOptionRSATCheck)){ + If ($WPFtxtTab2Name2.Text){ + Start-ButtonProcess -Path "$ADMSC" -Parameters ("/ComputerName " + $WPFtxtTab2Name2.Text) -CustomRunMsg "Opening [$ButtonClicked] on DHCP Server: $($WPFtxtTab2Name2.Text)" -OutputTab Tab2 -WindowStyle Normal + } + Else{ + Start-ButtonProcess -Path "$ADMSC" -CustomRunMsg "Opening [$ButtonClicked]" -OutputTab Tab2 -WindowStyle Normal + } + } + Else{ + Write-OutputBox -OutputBoxMessage "Unable to open [$ButtonClicked], RSAT is not detected or may not be installed" -Type "ERROR: " -Object Tab2 + } +} + + +function Call-btnTab2_10{ + +} + + +# Set of 4 large buttons under right columnl +function Call-btnTab2_11{ + Start-ButtonProcess -ProcessCall module -Path ActiveDirectory -OutputTab Tab2 -WindowStyle Normal +} + +function Call-btnTab2_12{ +} + +function Call-btnTab2_13{ + +} + +function Call-btnTab2_14{ + +} + +# Set of 12 small buttons under right column +function Call-btnTab2_15{ + Start-ButtonProcess -Path "$envWinDir\system32\ServerManager.exe" -OutputTab Tab2 -WindowStyle Normal +} + +function Call-btnTab2_16{ + +} + +function Call-btnTab2_17{ + +} + +function Call-btnTab2_18{ + If ($Global:SelectedRunAs){ + Start-ButtonProcess -ProcessCall ps1 -File "Connect-Mstsc.ps1" -Parameters "-ComputerName $($WPFtxtTab2Name2.Text)" -OutputTab tab2 -CreateNoWindow + } + Else{ + Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab2Name2.Text) -OutputTab tab2 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab2Name2.Text)" -NeverRunAs -WindowStyle Normal + } +} + +function Call-btnTab2_19{ +} + +function Call-btnTab2_20{ + +} + +function Call-btnTab2_21{ + +} + +function Call-btnTab2_22{ + +} + + +function Call-btnTab2_23{ + +} + +function Call-btnTab2_24{ + +} + +function Call-btnTab2_25{ + +} + +function Call-btnTab2_26{ + +} + + +##*============================================= +##* TAB 2 FUNCTIONS +##*============================================= + + + + +##*============================================= +##* BUILD TAB 2 BUTTONS IF CONFIGURED +##*============================================= +$ConfigTab2_Name = $ConfigTab2.Name + +$WPFTab2.Header = $ConfigTab2_Name +$WPFlblTab2Section1.Content = $ConfigTab2.section1Label +$WPFlblTab2Section2.Content = $ConfigTab2.section2Label + +$ConfigTab2_btns = $ConfigTab2.button + + +Foreach ($button in $ConfigTab2_btns){ + + [string]$buttonID = $button.id + If ($AppOptionDebugeMode){Write-Host "Tab2: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} + + If ($buttonID -eq "01"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_01.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_01.IsEnabled = $false} Else {$WPFbtnTab2_01.IsEnabled = $true} + $WPFbtnTextTab2_01.Text = $button.Name + $WPFbtnTab2_01.Background = $button.bgcolor + $WPFbtnTab2_01.Foreground = $button.textcolor + #$WPFbtnTab2_01.Add_Click({Call-btnTab2_01}) + $WPFbtnTab2_01.add_Click({ + $ButtonClicked = $WPFbtnTextTab2_01.Text + Call-btnTab2_01 + }) + } + + If ($buttonID -eq "02"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_02.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_02.IsEnabled = $false} Else {$WPFbtnTab2_02.IsEnabled = $true} + $WPFbtnTextTab2_02.Text = $button.Name + $WPFbtnTab2_02.Background = $button.bgcolor + $WPFbtnTab2_02.Foreground = $button.textcolor + $WPFbtnTab2_02.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_02.Text + Call-btnTab2_02 + }) + } + + If ($buttonID -eq "03"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_03.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_03.IsEnabled = $false} Else {$WPFbtnTab2_03.IsEnabled = $true} + $WPFbtnTextTab2_03.Text = $button.Name + $WPFbtnTab2_03.Background = $button.bgcolor + $WPFbtnTab2_03.Foreground = $button.textcolor + $WPFbtnTab2_03.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_03.Text + Call-btnTab2_03 + }) + } + + If ($buttonID -eq "04"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_04.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_04.IsEnabled = $false} Else {$WPFbtnTab2_04.IsEnabled = $true} + $WPFbtnTextTab2_04.Text = $button.Name + $WPFbtnTab2_04.Background = $button.bgcolor + $WPFbtnTab2_04.Foreground = $button.textcolor + $WPFbtnTab2_04.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_04.Text + Call-btnTab2_04 + }) + } + + If ($buttonID -eq "05"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_05.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_05.IsEnabled = $false} Else {$WPFbtnTab2_05.IsEnabled = $true} + $WPFbtnTextTab2_05.Text = $button.Name + $WPFbtnTab2_05.Background = $button.bgcolor + $WPFbtnTab2_05.Foreground = $button.textcolor + $WPFbtnTab2_05.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_05.Text + Call-btnTab2_05 + }) + } + + If ($buttonID -eq "06"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_06.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_06.IsEnabled = $false} Else {$WPFbtnTab2_06.IsEnabled = $true} + $WPFbtnTextTab2_06.Text = $button.Name + $WPFbtnTab2_06.Background = $button.bgcolor + $WPFbtnTab2_06.Foreground = $button.textcolor + $WPFbtnTab2_06.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_06.Text + Call-btnTab2_06 + }) + } + + If ($buttonID -eq "07"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_07.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_07.IsEnabled = $false} Else {$WPFbtnTab2_07.IsEnabled = $true} + $WPFbtnTextTab2_07.Text = $button.Name + $WPFbtnTab2_07.Background = $button.bgcolor + $WPFbtnTab2_07.Foreground = $button.textcolor + $WPFbtnTab2_07.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_07.Text + Call-btnTab2_07 + }) + } + + If ($buttonID -eq "08"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_08.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_08.IsEnabled = $false} Else {$WPFbtnTab2_08.IsEnabled = $true} + $WPFbtnTextTab2_08.Text = $button.Name + $WPFbtnTab2_08.Background = $button.bgcolor + $WPFbtnTab2_08.Foreground = $button.textcolor + $WPFbtnTab2_08.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_08.Text + Call-btnTab2_08 + }) + } + + If ($buttonID -eq "09"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_09.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_09.IsEnabled = $false} Else {$WPFbtnTab2_09.IsEnabled = $true} + $WPFbtnTextTab2_09.Text = $button.Name + $WPFbtnTab2_09.Background = $button.bgcolor + $WPFbtnTab2_09.Foreground = $button.textcolor + $WPFbtnTab2_09.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_09.Text + Call-btnTab2_09 + }) + } + + If ($buttonID -eq "10"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_10.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_10.IsEnabled = $false} Else {$WPFbtnTab2_10.IsEnabled = $true} + $WPFbtnTextTab2_10.Text = $button.Name + $WPFbtnTab2_10.Background = $button.bgcolor + $WPFbtnTab2_10.Foreground = $button.textcolor + $WPFbtnTab2_10.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_10.Text + Call-btnTab2_10 + }) + } + + If ($buttonID -eq "11"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_11.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_11.IsEnabled = $false} Else {$WPFbtnTab2_11.IsEnabled = $true} + $WPFbtnTextTab2_11.Text = $button.Name + $WPFbtnTab2_11.Background = $button.bgcolor + $WPFbtnTab2_11.Foreground = $button.textcolor + $WPFbtnTab2_11.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_11.Text + Call-btnTab2_11 + }) + } + + If ($buttonID -eq "12"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_12.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_12.IsEnabled = $false} Else {$WPFbtnTab2_12.IsEnabled = $true} + $WPFbtnTextTab2_12.Text = $button.Name + $WPFbtnTab2_12.Background = $button.bgcolor + $WPFbtnTab2_12.Foreground = $button.textcolor + $WPFbtnTab2_12.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_12.Text + Call-btnTab2_12 + }) + } + + If ($buttonID -eq "13"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_13.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_13.IsEnabled = $false} Else {$WPFbtnTab2_13.IsEnabled = $true} + $WPFbtnTextTab2_13.Text = $button.Name + $WPFbtnTab2_13.Background = $button.bgcolor + $WPFbtnTab2_13.Foreground = $button.textcolor + $WPFbtnTab2_13.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_13.Text + Call-btnTab2_13 + }) + } + If ($buttonID -eq "14"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_14.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_14.IsEnabled = $false} Else {$WPFbtnTab2_14.IsEnabled = $true} + $WPFbtnTextTab2_14.Text = $button.Name + $WPFbtnTab2_14.Background = $button.bgcolor + $WPFbtnTab2_14.Foreground = $button.textcolor + $WPFbtnTab2_14.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_14.Text + Call-btnTab2_14 + }) + } + + If ($buttonID -eq "15"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_15.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_15.IsEnabled = $false} Else {$WPFbtnTab2_15.IsEnabled = $true} + $WPFbtnTextTab2_15.Text = $button.Name + $WPFbtnTab2_15.Background = $button.bgcolor + $WPFbtnTab2_15.Foreground = $button.textcolor + $WPFbtnTab2_15.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_15.Text + Call-btnTab2_15 + }) + } + + If ($buttonID -eq "16"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_16.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_16.IsEnabled = $false} Else {$WPFbtnTab2_16.IsEnabled = $true} + $WPFbtnTextTab2_16.Text = $button.Name + $WPFbtnTab2_16.Background = $button.bgcolor + $WPFbtnTab2_16.Foreground = $button.textcolor + $WPFbtnTab2_16.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_16.Text + Call-btnTab2_16 + }) + } + + If ($buttonID -eq "17"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_17.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_17.IsEnabled = $false} Else {$WPFbtnTab2_17.IsEnabled = $true} + $WPFbtnTextTab2_17.Text = $button.Name + $WPFbtnTab2_17.Background = $button.bgcolor + $WPFbtnTab2_17.Foreground = $button.textcolor + $WPFbtnTab2_17.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_17.Text + Call-btnTab2_17 + }) + } + + If ($buttonID -eq "18"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_18.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_18.IsEnabled = $false} Else {$WPFbtnTab2_18.IsEnabled = $true} + $WPFbtnTextTab2_18.Text = $button.Name + $WPFbtnTab2_18.Background = $button.bgcolor + $WPFbtnTab2_18.Foreground = $button.textcolor + $WPFbtnTab2_18.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_18.Text + Call-btnTab2_18 + }) + } + + If ($buttonID -eq "19"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_19.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_19.IsEnabled = $false} Else {$WPFbtnTab2_19.IsEnabled = $true} + $WPFbtnTextTab2_19.Text = $button.Name + $WPFbtnTab2_19.Background = $button.bgcolor + $WPFbtnTab2_19.Foreground = $button.textcolor + $WPFbtnTab2_19.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_19.Text + Call-btnTab2_19 + }) + } + + If ($buttonID -eq "20"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_20.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_20.IsEnabled = $false} Else {$WPFbtnTab2_20.IsEnabled = $true} + $WPFbtnTextTab2_20.Text = $button.Name + $WPFbtnTab2_20.Background = $button.bgcolor + $WPFbtnTab2_20.Foreground = $button.textcolor + $WPFbtnTab2_20.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_20.Text + Call-btnTab2_20 + }) + } + + If ($buttonID -eq "21"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_21.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_21.IsEnabled = $false} Else {$WPFbtnTab2_21.IsEnabled = $true} + $WPFbtnTextTab2_21.Text = $button.Name + $WPFbtnTab2_21.Background = $button.bgcolor + $WPFbtnTab2_21.Foreground = $button.textcolor + $WPFbtnTab2_21.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_21.Text + Call-btnTab2_21 + }) + } + + If ($buttonID -eq "22"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_22.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_22.IsEnabled = $false} Else {$WPFbtnTab2_22.IsEnabled = $true} + $WPFbtnTextTab2_22.Text = $button.Name + $WPFbtnTab2_22.Background = $button.bgcolor + $WPFbtnTab2_22.Foreground = $button.textcolor + $WPFbtnTab2_22.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_22.Text + Call-btnTab2_22 + }) + } + + If ($buttonID -eq "23"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_23.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_23.IsEnabled = $false} Else {$WPFbtnTab2_23.IsEnabled = $true} + $WPFbtnTextTab2_23.Text = $button.Name + $WPFbtnTab2_23.Background = $button.bgcolor + $WPFbtnTab2_23.Foreground = $button.textcolor + $WPFbtnTab2_23.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_23.Text + Call-btnTab2_23 + }) + } + + If ($buttonID -eq "24"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_24.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_24.IsEnabled = $false} Else {$WPFbtnTab2_24.IsEnabled = $true} + $WPFbtnTextTab2_24.Text = $button.Name + $WPFbtnTab2_24.Background = $button.bgcolor + $WPFbtnTab2_24.Foreground = $button.textcolor + $WPFbtnTab2_24.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_24.Text + Call-btnTab2_24 + }) + } + + If ($buttonID -eq "25"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_25.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_25.IsEnabled = $false} Else {$WPFbtnTab2_25.IsEnabled = $true} + $WPFbtnTextTab2_25.Text = $button.Name + $WPFbtnTab2_25.Background = $button.bgcolor + $WPFbtnTab2_25.Foreground = $button.textcolor + $WPFbtnTab2_25.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_25.Text + Call-btnTab2_25 + }) + } + + If ($buttonID -eq "26"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab2_26.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab2_26.IsEnabled = $false} Else {$WPFbtnTab2_26.IsEnabled = $true} + $WPFbtnTextTab2_26.Text = $button.Name + $WPFbtnTab2_26.Background = $button.bgcolor + $WPFbtnTab2_26.Foreground = $button.textcolor + $WPFbtnTab2_26.Add_Click({ + $ButtonClicked = $WPFbtnTextTab2_26.Text + Call-btnTab2_26 + }) + } + +} If ($ConfigTab2.enable -eq "false"){$WPFtab2.Visibility = 'Hidden'} Else {$WPFtab2.Visibility = 'Visible'} \ No newline at end of file diff --git a/App/Extensions/TabControl/AdminMenu-Tab3.ps1 b/Extensions/TabControl/AdminMenu-Tab3.ps1 similarity index 96% rename from App/Extensions/TabControl/AdminMenu-Tab3.ps1 rename to Extensions/TabControl/AdminMenu-Tab3.ps1 index 70b1c45..6d8d9e9 100644 --- a/App/Extensions/TabControl/AdminMenu-Tab3.ps1 +++ b/Extensions/TabControl/AdminMenu-Tab3.ps1 @@ -1,531 +1,531 @@ -##*============================================= -##* LOAD TAB 3 FROM CONFIG -##*============================================= -$ConfigTab3 = $AppMenuTabandButtons.tab[2] -If ($HashNames.Keys -eq "Tab3"){ - Write-Host "Found Tab3 section in Names File" -ForegroundColor Gray - $Tab3HashNames = $HashNames.Tab3 - [string]$Tab3HashList = $Tab3HashNames| out-string -stream - write-Host "`nNames found in list: `n$Tab3HashList" -} -Else{ - Write-Host "No Tab3 section found in names file" -ForegroundColor Gray -} - -Try{$SMSSiteCode = ($([WmiClass]"ROOT\ccm:SMS_Client").getassignedsite()).sSiteCode}Catch{$SMSSiteCode = "N/A"} - -$WPFtxtTab3Name1.Text = $SMSSiteCode - -$WPFbtnTab3Name2List.add_Click({Save-ComputerList -TitleDesc "List of Sytem Center Server" -TabObject Tab3}) -##*============================================= -##* FORM ADD CLICK FUNCTIONS -##*============================================= -<# - Examples to use (place in function): - - SIMPLE: - Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal - - SEND TO OUTPUT (PASSTHRU): - Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 - $PasstoOutput = Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String - If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} - - OPEN EXTERNAL PS1 - . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") - - USE INTGRATED FUNCTION (EASIEST) - - to log to output box in tab, use -OutputTab switch - - to identify process alias, use -Alias switch, otherwise path will be used instead - - to specify a custom run message use the -CustomRunMsg switch - - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) - - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch - - EXAMPLE (EXE): - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (EXE) with Parameters: - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$env:windir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (PS1): - Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow - -#> -# Set of 6 large buttons under left column -function Call-btnTab3_01{ - $SCCM = "$($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\Microsoft.ConfigurationManagement.exe')" - Start-ButtonProcess -Path $SCCM -OutputTab Tab3 -WindowStyle Normal -} - -function Call-btnTab3_02{ - $DPWB = "$envProgramFiles\Microsoft Deployment Toolkit\Bin\DeploymentWorkbench.msc" - Start-ButtonProcess -Path "$DPWB" -OutputTab Tab3 -WindowStyle Normal -} - -function Call-btnTab3_03{ - $SCSM = "$envProgramFiles\Microsoft System Center 2012 R2\Service Manager\Microsoft.EnterpriseManagement.ServiceManager.UI.Console.exe" - Start-ButtonProcess -Path $SCSM -OutputTab Tab3 -WindowStyle Normal -} - -function Call-btnTab3_04{ - -} - -function Call-btnTab3_05{ - -} - -function Call-btnTab3_06{ - -} - -# Set of 4 small buttons under left column -function Call-btnTab3_07{ - Start-ButtonProcess -Path "$envProgramFiles\Microsoft DaRT\v10\DartRemoteViewer.exe" -OutputTab Tab3 -WindowStyle Normal -} - -function Call-btnTab3_08{ - -} - - -function Call-btnTab3_09{ - -} - - -function Call-btnTab3_10{ - Start-ButtonProcess -Path "C:\Program Files\SCCM Tools\SCCM Client Center\SMSCliCtrV2.exe" -OutputTab Tab3 -WindowStyle Normal -} - - -# Set of 4 large buttons under right column -function Call-btnTab3_11{ -} - -function Call-btnTab3_12{ - -} - -function Call-btnTab3_13{ - -} - -function Call-btnTab3_14{ - -} - -# Set of 12 small buttons under right column -function Call-btnTab3_15{ -} - -function Call-btnTab3_16{ - Start-ButtonProcess -Path "$envProgramFilesX86\ConfigMgr 2012 Toolkit R2\ClientTools\PolicySpy.exe" -OutputTab Tab3 -WindowStyle Normal -} - -function Call-btnTab3_17{ - Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshCAT.ps1" -WorkingScriptDirectory "PoshCAT_0.2" -OutputTab tab3 -WindowStyle Hidden -} - -function Call-btnTab3_18{ -Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab3Name2.Text) -OutputTab Tab3 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab3Name2.Text)" -NeverRunAs -WindowStyle Normal -} - -function Call-btnTab3_19{ - -} - -function Call-btnTab3_20{ - -} - -function Call-btnTab3_21{ - -} - -function Call-btnTab3_22{ - -} - -function Call-btnTab3_23{ - -} - -function Call-btnTab3_24{ - -} - - -function Call-btnTab3_25{ - -} - -function Call-btnTab3_26{ - Start-ButtonProcess -ProcessCall ps1 -File "Install-ConfigMgrPrereqsGUI_1.4.2.ps1" -OutputTab tab3 -CreateNoWindow -} - - - -##*============================================= -##* TAB 3 FUNCTIONS -##*============================================= - - - -##*============================================= -##* BUILD TAB 3 BUTTONS IF CONFIGURED -##*============================================= -$ConfigTab3_Name = $ConfigTab3.Name - -$WPFTab3.Header = $ConfigTab3_Name -$WPFlblTab3Section1.Content = $ConfigTab3.section1Label -$WPFlblTab3Section2.Content = $ConfigTab3.section2Label - -$ConfigTab3_btns = $ConfigTab3.button - - -Foreach ($button in $ConfigTab3_btns){ - - [string]$buttonID = $button.id - If ($AppOptionDebugeMode){Write-Host "Tab3: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} - - If ($buttonID -eq "01"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_01.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_01.IsEnabled = $false} Else {$WPFbtnTab3_01.IsEnabled = $true} - $WPFbtnTextTab3_01.Text = $button.Name - $WPFbtnTab3_01.Background = $button.bgcolor - $WPFbtnTab3_01.Foreground = $button.textcolor - #$WPFbtnTab3_01.Add_Click({Call-btnTab3_01}) - $WPFbtnTab3_01.add_Click({ - $ButtonClicked = $WPFbtnTextTab3_01.Text - Call-btnTab3_01 - }) - } - - If ($buttonID -eq "02"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_02.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_02.IsEnabled = $false} Else {$WPFbtnTab3_02.IsEnabled = $true} - $WPFbtnTextTab3_02.Text = $button.Name - $WPFbtnTab3_02.Background = $button.bgcolor - $WPFbtnTab3_02.Foreground = $button.textcolor - $WPFbtnTab3_02.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_02.Text - Call-btnTab3_02 - }) - } - - If ($buttonID -eq "03"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_03.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_03.IsEnabled = $false} Else {$WPFbtnTab3_03.IsEnabled = $true} - $WPFbtnTextTab3_03.Text = $button.Name - $WPFbtnTab3_03.Background = $button.bgcolor - $WPFbtnTab3_03.Foreground = $button.textcolor - $WPFbtnTab3_03.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_03.Text - Call-btnTab3_03 - }) - } - - If ($buttonID -eq "04"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_04.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_04.IsEnabled = $false} Else {$WPFbtnTab3_04.IsEnabled = $true} - $WPFbtnTextTab3_04.Text = $button.Name - $WPFbtnTab3_04.Background = $button.bgcolor - $WPFbtnTab3_04.Foreground = $button.textcolor - $WPFbtnTab3_04.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_04.Text - Call-btnTab3_04 - }) - } - - If ($buttonID -eq "05"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_05.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_05.IsEnabled = $false} Else {$WPFbtnTab3_05.IsEnabled = $true} - $WPFbtnTextTab3_05.Text = $button.Name - $WPFbtnTab3_05.Background = $button.bgcolor - $WPFbtnTab3_05.Foreground = $button.textcolor - $WPFbtnTab3_05.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_05.Text - Call-btnTab3_05 - }) - } - - If ($buttonID -eq "06"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_06.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_06.IsEnabled = $false} Else {$WPFbtnTab3_06.IsEnabled = $true} - $WPFbtnTextTab3_06.Text = $button.Name - $WPFbtnTab3_06.Background = $button.bgcolor - $WPFbtnTab3_06.Foreground = $button.textcolor - $WPFbtnTab3_06.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_06.Text - Call-btnTab3_06 - }) - } - - If ($buttonID -eq "07"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_07.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_07.IsEnabled = $false} Else {$WPFbtnTab3_07.IsEnabled = $true} - $WPFbtnTextTab3_07.Text = $button.Name - $WPFbtnTab3_07.Background = $button.bgcolor - $WPFbtnTab3_07.Foreground = $button.textcolor - $WPFbtnTab3_07.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_07.Text - Call-btnTab3_07 - }) - } - - If ($buttonID -eq "08"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_08.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_08.IsEnabled = $false} Else {$WPFbtnTab3_08.IsEnabled = $true} - $WPFbtnTextTab3_08.Text = $button.Name - $WPFbtnTab3_08.Background = $button.bgcolor - $WPFbtnTab3_08.Foreground = $button.textcolor - $WPFbtnTab3_08.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_08.Text - Call-btnTab3_08 - }) - } - - If ($buttonID -eq "09"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_09.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_09.IsEnabled = $false} Else {$WPFbtnTab3_09.IsEnabled = $true} - $WPFbtnTextTab3_09.Text = $button.Name - $WPFbtnTab3_09.Background = $button.bgcolor - $WPFbtnTab3_09.Foreground = $button.textcolor - $WPFbtnTab3_09.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_09.Text - Call-btnTab3_09 - }) - } - - If ($buttonID -eq "10"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_10.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_10.IsEnabled = $false} Else {$WPFbtnTab3_10.IsEnabled = $true} - $WPFbtnTextTab3_10.Text = $button.Name - $WPFbtnTab3_10.Background = $button.bgcolor - $WPFbtnTab3_10.Foreground = $button.textcolor - $WPFbtnTab3_10.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_10.Text - Call-btnTab3_10 - }) - } - - If ($buttonID -eq "11"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_11.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_11.IsEnabled = $false} Else {$WPFbtnTab3_11.IsEnabled = $true} - $WPFbtnTextTab3_11.Text = $button.Name - $WPFbtnTab3_11.Background = $button.bgcolor - $WPFbtnTab3_11.Foreground = $button.textcolor - $WPFbtnTab3_11.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_11.Text - Call-btnTab3_11 - }) - } - - If ($buttonID -eq "12"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_12.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_12.IsEnabled = $false} Else {$WPFbtnTab3_12.IsEnabled = $true} - $WPFbtnTextTab3_12.Text = $button.Name - $WPFbtnTab3_12.Background = $button.bgcolor - $WPFbtnTab3_12.Foreground = $button.textcolor - $WPFbtnTab3_12.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_12.Text - Call-btnTab3_12 - }) - } - - If ($buttonID -eq "13"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_13.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_13.IsEnabled = $false} Else {$WPFbtnTab3_13.IsEnabled = $true} - $WPFbtnTextTab3_13.Text = $button.Name - $WPFbtnTab3_13.Background = $button.bgcolor - $WPFbtnTab3_13.Foreground = $button.textcolor - $WPFbtnTab3_13.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_13.Text - Call-btnTab3_13 - }) - } - If ($buttonID -eq "14"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_14.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_14.IsEnabled = $false} Else {$WPFbtnTab3_14.IsEnabled = $true} - $WPFbtnTextTab3_14.Text = $button.Name - $WPFbtnTab3_14.Background = $button.bgcolor - $WPFbtnTab3_14.Foreground = $button.textcolor - $WPFbtnTab3_14.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_14.Text - Call-btnTab3_14 - }) - } - - If ($buttonID -eq "15"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_15.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_15.IsEnabled = $false} Else {$WPFbtnTab3_15.IsEnabled = $true} - $WPFbtnTextTab3_15.Text = $button.Name - $WPFbtnTab3_15.Background = $button.bgcolor - $WPFbtnTab3_15.Foreground = $button.textcolor - $WPFbtnTab3_15.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_15.Text - Call-btnTab3_15 - }) - } - - If ($buttonID -eq "16"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_16.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_16.IsEnabled = $false} Else {$WPFbtnTab3_16.IsEnabled = $true} - $WPFbtnTextTab3_16.Text = $button.Name - $WPFbtnTab3_16.Background = $button.bgcolor - $WPFbtnTab3_16.Foreground = $button.textcolor - $WPFbtnTab3_16.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_16.Text - Call-btnTab3_16 - }) - } - - If ($buttonID -eq "17"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_17.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_17.IsEnabled = $false} Else {$WPFbtnTab3_17.IsEnabled = $true} - $WPFbtnTextTab3_17.Text = $button.Name - $WPFbtnTab3_17.Background = $button.bgcolor - $WPFbtnTab3_17.Foreground = $button.textcolor - $WPFbtnTab3_17.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_17.Text - Call-btnTab3_17 - }) - } - - If ($buttonID -eq "18"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_18.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_18.IsEnabled = $false} Else {$WPFbtnTab3_18.IsEnabled = $true} - $WPFbtnTextTab3_18.Text = $button.Name - $WPFbtnTab3_18.Background = $button.bgcolor - $WPFbtnTab3_18.Foreground = $button.textcolor - $WPFbtnTab3_18.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_18.Text - Call-btnTab3_18 - }) - } - - If ($buttonID -eq "19"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_19.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_19.IsEnabled = $false} Else {$WPFbtnTab3_19.IsEnabled = $true} - $WPFbtnTextTab3_19.Text = $button.Name - $WPFbtnTab3_19.Background = $button.bgcolor - $WPFbtnTab3_19.Foreground = $button.textcolor - $WPFbtnTab3_19.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_19.Text - Call-btnTab3_19 - }) - } - - If ($buttonID -eq "20"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_20.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_20.IsEnabled = $false} Else {$WPFbtnTab3_20.IsEnabled = $true} - $WPFbtnTextTab3_20.Text = $button.Name - $WPFbtnTab3_20.Background = $button.bgcolor - $WPFbtnTab3_20.Foreground = $button.textcolor - $WPFbtnTab3_20.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_20.Text - Call-btnTab3_20 - }) - } - - If ($buttonID -eq "21"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_21.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_21.IsEnabled = $false} Else {$WPFbtnTab3_21.IsEnabled = $true} - $WPFbtnTextTab3_21.Text = $button.Name - $WPFbtnTab3_21.Background = $button.bgcolor - $WPFbtnTab3_21.Foreground = $button.textcolor - $WPFbtnTab3_21.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_21.Text - Call-btnTab3_21 - }) - } - - If ($buttonID -eq "22"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_22.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_22.IsEnabled = $false} Else {$WPFbtnTab3_22.IsEnabled = $true} - $WPFbtnTextTab3_22.Text = $button.Name - $WPFbtnTab3_22.Background = $button.bgcolor - $WPFbtnTab3_22.Foreground = $button.textcolor - $WPFbtnTab3_22.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_22.Text - Call-btnTab3_22 - }) - } - - If ($buttonID -eq "23"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_23.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_23.IsEnabled = $false} Else {$WPFbtnTab3_23.IsEnabled = $true} - $WPFbtnTextTab3_23.Text = $button.Name - $WPFbtnTab3_23.Background = $button.bgcolor - $WPFbtnTab3_23.Foreground = $button.textcolor - $WPFbtnTab3_23.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_23.Text - Call-btnTab3_23 - }) - } - - If ($buttonID -eq "24"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_24.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_24.IsEnabled = $false} Else {$WPFbtnTab3_24.IsEnabled = $true} - $WPFbtnTextTab3_24.Text = $button.Name - $WPFbtnTab3_24.Background = $button.bgcolor - $WPFbtnTab3_24.Foreground = $button.textcolor - $WPFbtnTab3_24.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_24.Text - Call-btnTab3_24 - }) - } - - If ($buttonID -eq "25"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_25.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_25.IsEnabled = $false} Else {$WPFbtnTab3_25.IsEnabled = $true} - $WPFbtnTextTab3_25.Text = $button.Name - $WPFbtnTab3_25.Background = $button.bgcolor - $WPFbtnTab3_25.Foreground = $button.textcolor - $WPFbtnTab3_25.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_25.Text - Call-btnTab3_25 - }) - } - - If ($buttonID -eq "26"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab3_26.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab3_26.IsEnabled = $false} Else {$WPFbtnTab3_26.IsEnabled = $true} - $WPFbtnTextTab3_26.Text = $button.Name - $WPFbtnTab3_26.Background = $button.bgcolor - $WPFbtnTab3_26.Foreground = $button.textcolor - $WPFbtnTab3_26.Add_Click({ - $ButtonClicked = $WPFbtnTextTab3_26.Text - Call-btnTab3_26 - }) - } - -} +##*============================================= +##* LOAD TAB 3 FROM CONFIG +##*============================================= +$ConfigTab3 = $AppMenuTabandButtons.tab[2] +If ($HashNames.Keys -eq "Tab3"){ + Write-Host "Found Tab3 section in Names File" -ForegroundColor Gray + $Tab3HashNames = $HashNames.Tab3 + [string]$Tab3HashList = $Tab3HashNames| out-string -stream + write-Host "`nNames found in list: `n$Tab3HashList" +} +Else{ + Write-Host "No Tab3 section found in names file" -ForegroundColor Gray +} + +Try{$SMSSiteCode = ($([WmiClass]"ROOT\ccm:SMS_Client").getassignedsite()).sSiteCode}Catch{$SMSSiteCode = "N/A"} + +$WPFtxtTab3Name1.Text = $SMSSiteCode + +$WPFbtnTab3Name2List.add_Click({Save-ComputerList -TitleDesc "List of Sytem Center Server" -TabObject Tab3}) +##*============================================= +##* FORM ADD CLICK FUNCTIONS +##*============================================= +<# + Examples to use (place in function): + + SIMPLE: + Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal + + SEND TO OUTPUT (PASSTHRU): + Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 + $PasstoOutput = Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String + If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} + + OPEN EXTERNAL PS1 + . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") + + USE INTGRATED FUNCTION (EASIEST) + - to log to output box in tab, use -OutputTab switch + - to identify process alias, use -Alias switch, otherwise path will be used instead + - to specify a custom run message use the -CustomRunMsg switch + - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) + - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch + + EXAMPLE (EXE): + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (EXE) with Parameters: + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$env:windir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (PS1): + Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow + +#> +# Set of 6 large buttons under left column +function Call-btnTab3_01{ + $SCCM = "$($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\Microsoft.ConfigurationManagement.exe')" + Start-ButtonProcess -Path $SCCM -OutputTab Tab3 -WindowStyle Normal +} + +function Call-btnTab3_02{ + $DPWB = "$envProgramFiles\Microsoft Deployment Toolkit\Bin\DeploymentWorkbench.msc" + Start-ButtonProcess -Path "$DPWB" -OutputTab Tab3 -WindowStyle Normal +} + +function Call-btnTab3_03{ + $SCSM = "$envProgramFiles\Microsoft System Center 2012 R2\Service Manager\Microsoft.EnterpriseManagement.ServiceManager.UI.Console.exe" + Start-ButtonProcess -Path $SCSM -OutputTab Tab3 -WindowStyle Normal +} + +function Call-btnTab3_04{ + +} + +function Call-btnTab3_05{ + +} + +function Call-btnTab3_06{ + +} + +# Set of 4 small buttons under left column +function Call-btnTab3_07{ + Start-ButtonProcess -Path "$envProgramFiles\Microsoft DaRT\v10\DartRemoteViewer.exe" -OutputTab Tab3 -WindowStyle Normal +} + +function Call-btnTab3_08{ + +} + + +function Call-btnTab3_09{ + +} + + +function Call-btnTab3_10{ + Start-ButtonProcess -Path "C:\Program Files\SCCM Tools\SCCM Client Center\SMSCliCtrV2.exe" -OutputTab Tab3 -WindowStyle Normal +} + + +# Set of 4 large buttons under right column +function Call-btnTab3_11{ +} + +function Call-btnTab3_12{ + +} + +function Call-btnTab3_13{ + +} + +function Call-btnTab3_14{ + +} + +# Set of 12 small buttons under right column +function Call-btnTab3_15{ +} + +function Call-btnTab3_16{ + Start-ButtonProcess -Path "$envProgramFilesX86\ConfigMgr 2012 Toolkit R2\ClientTools\PolicySpy.exe" -OutputTab Tab3 -WindowStyle Normal +} + +function Call-btnTab3_17{ + Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshCAT.ps1" -WorkingScriptDirectory "PoshCAT_0.2" -OutputTab tab3 -WindowStyle Hidden +} + +function Call-btnTab3_18{ +Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab3Name2.Text) -OutputTab Tab3 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab3Name2.Text)" -NeverRunAs -WindowStyle Normal +} + +function Call-btnTab3_19{ + +} + +function Call-btnTab3_20{ + +} + +function Call-btnTab3_21{ + +} + +function Call-btnTab3_22{ + +} + +function Call-btnTab3_23{ + +} + +function Call-btnTab3_24{ + +} + + +function Call-btnTab3_25{ + +} + +function Call-btnTab3_26{ + Start-ButtonProcess -ProcessCall ps1 -File "Install-ConfigMgrPrereqsGUI_1.4.2.ps1" -OutputTab tab3 -CreateNoWindow +} + + + +##*============================================= +##* TAB 3 FUNCTIONS +##*============================================= + + + +##*============================================= +##* BUILD TAB 3 BUTTONS IF CONFIGURED +##*============================================= +$ConfigTab3_Name = $ConfigTab3.Name + +$WPFTab3.Header = $ConfigTab3_Name +$WPFlblTab3Section1.Content = $ConfigTab3.section1Label +$WPFlblTab3Section2.Content = $ConfigTab3.section2Label + +$ConfigTab3_btns = $ConfigTab3.button + + +Foreach ($button in $ConfigTab3_btns){ + + [string]$buttonID = $button.id + If ($AppOptionDebugeMode){Write-Host "Tab3: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} + + If ($buttonID -eq "01"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_01.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_01.IsEnabled = $false} Else {$WPFbtnTab3_01.IsEnabled = $true} + $WPFbtnTextTab3_01.Text = $button.Name + $WPFbtnTab3_01.Background = $button.bgcolor + $WPFbtnTab3_01.Foreground = $button.textcolor + #$WPFbtnTab3_01.Add_Click({Call-btnTab3_01}) + $WPFbtnTab3_01.add_Click({ + $ButtonClicked = $WPFbtnTextTab3_01.Text + Call-btnTab3_01 + }) + } + + If ($buttonID -eq "02"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_02.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_02.IsEnabled = $false} Else {$WPFbtnTab3_02.IsEnabled = $true} + $WPFbtnTextTab3_02.Text = $button.Name + $WPFbtnTab3_02.Background = $button.bgcolor + $WPFbtnTab3_02.Foreground = $button.textcolor + $WPFbtnTab3_02.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_02.Text + Call-btnTab3_02 + }) + } + + If ($buttonID -eq "03"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_03.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_03.IsEnabled = $false} Else {$WPFbtnTab3_03.IsEnabled = $true} + $WPFbtnTextTab3_03.Text = $button.Name + $WPFbtnTab3_03.Background = $button.bgcolor + $WPFbtnTab3_03.Foreground = $button.textcolor + $WPFbtnTab3_03.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_03.Text + Call-btnTab3_03 + }) + } + + If ($buttonID -eq "04"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_04.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_04.IsEnabled = $false} Else {$WPFbtnTab3_04.IsEnabled = $true} + $WPFbtnTextTab3_04.Text = $button.Name + $WPFbtnTab3_04.Background = $button.bgcolor + $WPFbtnTab3_04.Foreground = $button.textcolor + $WPFbtnTab3_04.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_04.Text + Call-btnTab3_04 + }) + } + + If ($buttonID -eq "05"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_05.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_05.IsEnabled = $false} Else {$WPFbtnTab3_05.IsEnabled = $true} + $WPFbtnTextTab3_05.Text = $button.Name + $WPFbtnTab3_05.Background = $button.bgcolor + $WPFbtnTab3_05.Foreground = $button.textcolor + $WPFbtnTab3_05.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_05.Text + Call-btnTab3_05 + }) + } + + If ($buttonID -eq "06"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_06.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_06.IsEnabled = $false} Else {$WPFbtnTab3_06.IsEnabled = $true} + $WPFbtnTextTab3_06.Text = $button.Name + $WPFbtnTab3_06.Background = $button.bgcolor + $WPFbtnTab3_06.Foreground = $button.textcolor + $WPFbtnTab3_06.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_06.Text + Call-btnTab3_06 + }) + } + + If ($buttonID -eq "07"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_07.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_07.IsEnabled = $false} Else {$WPFbtnTab3_07.IsEnabled = $true} + $WPFbtnTextTab3_07.Text = $button.Name + $WPFbtnTab3_07.Background = $button.bgcolor + $WPFbtnTab3_07.Foreground = $button.textcolor + $WPFbtnTab3_07.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_07.Text + Call-btnTab3_07 + }) + } + + If ($buttonID -eq "08"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_08.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_08.IsEnabled = $false} Else {$WPFbtnTab3_08.IsEnabled = $true} + $WPFbtnTextTab3_08.Text = $button.Name + $WPFbtnTab3_08.Background = $button.bgcolor + $WPFbtnTab3_08.Foreground = $button.textcolor + $WPFbtnTab3_08.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_08.Text + Call-btnTab3_08 + }) + } + + If ($buttonID -eq "09"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_09.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_09.IsEnabled = $false} Else {$WPFbtnTab3_09.IsEnabled = $true} + $WPFbtnTextTab3_09.Text = $button.Name + $WPFbtnTab3_09.Background = $button.bgcolor + $WPFbtnTab3_09.Foreground = $button.textcolor + $WPFbtnTab3_09.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_09.Text + Call-btnTab3_09 + }) + } + + If ($buttonID -eq "10"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_10.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_10.IsEnabled = $false} Else {$WPFbtnTab3_10.IsEnabled = $true} + $WPFbtnTextTab3_10.Text = $button.Name + $WPFbtnTab3_10.Background = $button.bgcolor + $WPFbtnTab3_10.Foreground = $button.textcolor + $WPFbtnTab3_10.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_10.Text + Call-btnTab3_10 + }) + } + + If ($buttonID -eq "11"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_11.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_11.IsEnabled = $false} Else {$WPFbtnTab3_11.IsEnabled = $true} + $WPFbtnTextTab3_11.Text = $button.Name + $WPFbtnTab3_11.Background = $button.bgcolor + $WPFbtnTab3_11.Foreground = $button.textcolor + $WPFbtnTab3_11.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_11.Text + Call-btnTab3_11 + }) + } + + If ($buttonID -eq "12"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_12.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_12.IsEnabled = $false} Else {$WPFbtnTab3_12.IsEnabled = $true} + $WPFbtnTextTab3_12.Text = $button.Name + $WPFbtnTab3_12.Background = $button.bgcolor + $WPFbtnTab3_12.Foreground = $button.textcolor + $WPFbtnTab3_12.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_12.Text + Call-btnTab3_12 + }) + } + + If ($buttonID -eq "13"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_13.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_13.IsEnabled = $false} Else {$WPFbtnTab3_13.IsEnabled = $true} + $WPFbtnTextTab3_13.Text = $button.Name + $WPFbtnTab3_13.Background = $button.bgcolor + $WPFbtnTab3_13.Foreground = $button.textcolor + $WPFbtnTab3_13.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_13.Text + Call-btnTab3_13 + }) + } + If ($buttonID -eq "14"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_14.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_14.IsEnabled = $false} Else {$WPFbtnTab3_14.IsEnabled = $true} + $WPFbtnTextTab3_14.Text = $button.Name + $WPFbtnTab3_14.Background = $button.bgcolor + $WPFbtnTab3_14.Foreground = $button.textcolor + $WPFbtnTab3_14.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_14.Text + Call-btnTab3_14 + }) + } + + If ($buttonID -eq "15"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_15.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_15.IsEnabled = $false} Else {$WPFbtnTab3_15.IsEnabled = $true} + $WPFbtnTextTab3_15.Text = $button.Name + $WPFbtnTab3_15.Background = $button.bgcolor + $WPFbtnTab3_15.Foreground = $button.textcolor + $WPFbtnTab3_15.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_15.Text + Call-btnTab3_15 + }) + } + + If ($buttonID -eq "16"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_16.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_16.IsEnabled = $false} Else {$WPFbtnTab3_16.IsEnabled = $true} + $WPFbtnTextTab3_16.Text = $button.Name + $WPFbtnTab3_16.Background = $button.bgcolor + $WPFbtnTab3_16.Foreground = $button.textcolor + $WPFbtnTab3_16.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_16.Text + Call-btnTab3_16 + }) + } + + If ($buttonID -eq "17"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_17.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_17.IsEnabled = $false} Else {$WPFbtnTab3_17.IsEnabled = $true} + $WPFbtnTextTab3_17.Text = $button.Name + $WPFbtnTab3_17.Background = $button.bgcolor + $WPFbtnTab3_17.Foreground = $button.textcolor + $WPFbtnTab3_17.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_17.Text + Call-btnTab3_17 + }) + } + + If ($buttonID -eq "18"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_18.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_18.IsEnabled = $false} Else {$WPFbtnTab3_18.IsEnabled = $true} + $WPFbtnTextTab3_18.Text = $button.Name + $WPFbtnTab3_18.Background = $button.bgcolor + $WPFbtnTab3_18.Foreground = $button.textcolor + $WPFbtnTab3_18.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_18.Text + Call-btnTab3_18 + }) + } + + If ($buttonID -eq "19"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_19.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_19.IsEnabled = $false} Else {$WPFbtnTab3_19.IsEnabled = $true} + $WPFbtnTextTab3_19.Text = $button.Name + $WPFbtnTab3_19.Background = $button.bgcolor + $WPFbtnTab3_19.Foreground = $button.textcolor + $WPFbtnTab3_19.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_19.Text + Call-btnTab3_19 + }) + } + + If ($buttonID -eq "20"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_20.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_20.IsEnabled = $false} Else {$WPFbtnTab3_20.IsEnabled = $true} + $WPFbtnTextTab3_20.Text = $button.Name + $WPFbtnTab3_20.Background = $button.bgcolor + $WPFbtnTab3_20.Foreground = $button.textcolor + $WPFbtnTab3_20.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_20.Text + Call-btnTab3_20 + }) + } + + If ($buttonID -eq "21"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_21.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_21.IsEnabled = $false} Else {$WPFbtnTab3_21.IsEnabled = $true} + $WPFbtnTextTab3_21.Text = $button.Name + $WPFbtnTab3_21.Background = $button.bgcolor + $WPFbtnTab3_21.Foreground = $button.textcolor + $WPFbtnTab3_21.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_21.Text + Call-btnTab3_21 + }) + } + + If ($buttonID -eq "22"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_22.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_22.IsEnabled = $false} Else {$WPFbtnTab3_22.IsEnabled = $true} + $WPFbtnTextTab3_22.Text = $button.Name + $WPFbtnTab3_22.Background = $button.bgcolor + $WPFbtnTab3_22.Foreground = $button.textcolor + $WPFbtnTab3_22.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_22.Text + Call-btnTab3_22 + }) + } + + If ($buttonID -eq "23"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_23.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_23.IsEnabled = $false} Else {$WPFbtnTab3_23.IsEnabled = $true} + $WPFbtnTextTab3_23.Text = $button.Name + $WPFbtnTab3_23.Background = $button.bgcolor + $WPFbtnTab3_23.Foreground = $button.textcolor + $WPFbtnTab3_23.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_23.Text + Call-btnTab3_23 + }) + } + + If ($buttonID -eq "24"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_24.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_24.IsEnabled = $false} Else {$WPFbtnTab3_24.IsEnabled = $true} + $WPFbtnTextTab3_24.Text = $button.Name + $WPFbtnTab3_24.Background = $button.bgcolor + $WPFbtnTab3_24.Foreground = $button.textcolor + $WPFbtnTab3_24.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_24.Text + Call-btnTab3_24 + }) + } + + If ($buttonID -eq "25"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_25.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_25.IsEnabled = $false} Else {$WPFbtnTab3_25.IsEnabled = $true} + $WPFbtnTextTab3_25.Text = $button.Name + $WPFbtnTab3_25.Background = $button.bgcolor + $WPFbtnTab3_25.Foreground = $button.textcolor + $WPFbtnTab3_25.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_25.Text + Call-btnTab3_25 + }) + } + + If ($buttonID -eq "26"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab3_26.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab3_26.IsEnabled = $false} Else {$WPFbtnTab3_26.IsEnabled = $true} + $WPFbtnTextTab3_26.Text = $button.Name + $WPFbtnTab3_26.Background = $button.bgcolor + $WPFbtnTab3_26.Foreground = $button.textcolor + $WPFbtnTab3_26.Add_Click({ + $ButtonClicked = $WPFbtnTextTab3_26.Text + Call-btnTab3_26 + }) + } + +} If ($ConfigTab3.enable -eq "false"){$WPFTab3.Visibility = 'Hidden'} Else {$WPFTab3.Visibility = 'Visible'} \ No newline at end of file diff --git a/App/Extensions/TabControl/AdminMenu-Tab4.ps1 b/Extensions/TabControl/AdminMenu-Tab4.ps1 similarity index 96% rename from App/Extensions/TabControl/AdminMenu-Tab4.ps1 rename to Extensions/TabControl/AdminMenu-Tab4.ps1 index fd66eef..da0a487 100644 --- a/App/Extensions/TabControl/AdminMenu-Tab4.ps1 +++ b/Extensions/TabControl/AdminMenu-Tab4.ps1 @@ -1,528 +1,528 @@ -##*============================================= -##* LOAD TAB 4 FROM CONFIG -##*============================================= -$ConfigTab4 = $AppMenuTabandButtons.tab[3] -If ($HashNames.Keys -eq "Tab4"){ - Write-Host "Found Tab4 section in Names File" -ForegroundColor Gray - $Tab4HashNames = $HashNames.Tab4 - [string]$Tab4HashList = $Tab4HashNames| out-string -stream - write-Host "`nNames found in list: `n$Tab4HashList" -} -Else{ - Write-Host "No Tab4 section found in names file" -ForegroundColor Gray -} -$WPFtxtTab4Name1.Text = "" - -$WPFbtnTab4Name1List.add_Click({Save-ComputerList -TitleDesc "List of Exchange Servers" -TabObject Tab4}) - -$Global:PSExchServer = "http://$($WPFtxtTab4Name1.Text)/PowerShell/" -$Global:PSLync = "http://$($WPFtxtTab4Name1.Text)/ocspowershell" -##*============================================= -##* FORM ADD CLICK FUNCTIONS -##*============================================= -<# - Examples to use (place in function): - - SIMPLE: - Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal - - SEND TO OUTPUT (PASSTHRU): - Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 - $PasstoOutput = Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String - If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} - - OPEN EXTERNAL PS1 - . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") - - USE INTGRATED FUNCTION (EASIEST) - - to log to output box in tab, use -OutputTab switch - - to identify process alias, use -Alias switch, otherwise path will be used instead - - to specify a custom run message use the -CustomRunMsg switch - - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) - - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch - - EXAMPLE (EXE): - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (EXE) with Parameters: - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$env:windir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (PS1): - Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow - -#> -# Set of 6 large buttons under left column -function Call-btnTab4_01{ - -} - -function Call-btnTab4_02{ - -} - -function Call-btnTab4_03{ - -} - -function Call-btnTab4_04{ - -} - -function Call-btnTab4_05{ - -} - -function Call-btnTab4_06{ - -} - -# Set of 4 small buttons under left column -function Call-btnTab4_07{ - -} - -function Call-btnTab4_08{ - -} - - -function Call-btnTab4_09{ - -} - - -function Call-btnTab4_10{ - -} - - -# Set of 4 large buttons under right column -function Call-btnTab4_11{ - Start-ButtonProcess -ProcessCall module -Path "$envProgramFiles\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto;" -OutputTab Tab4 -WindowStyle Normal - -} - -function Call-btnTab4_12{ - -} - -function Call-btnTab4_13{ - -} - -function Call-btnTab4_14{ - -} - -# Set of 12 small buttons under right column -function Call-btnTab4_15{ - -} - -function Call-btnTab4_16{ - -} - -function Call-btnTab4_17{ - Start-ButtonProcess -ProcessCall ps1 -File "ThumbnailPhotoManager.ps1" -OutputTab tab4 -CreateNoWindow -} - -function Call-btnTab4_18{ - Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab4Name1.Text) -OutputTab Tab4 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab4Name1.Text)" -NeverRunAs -WindowStyle Normal -} - -function Call-btnTab4_19{ - Start-ButtonProcess -ProcessCall ps1 -File "Get-ExchangeEnvironmentReport.ps1" -Parameters "-HTMLReport $envUserProfile\Desktop\ExchangeReport.html" -OutputTab tab4 -CreateNoWindow -} - -function Call-btnTab4_20{ - -} - -function Call-btnTab4_21{ - -} - -function Call-btnTab4_22{ - Start-ButtonProcess -ProcessCall ps1 -File "New-ExchangeMailboxAudit-GUI.ps1" -WorkingScriptDirectory "ExchangeMailboxAuditReport\Script" -OutputTab tab4 -CreateNoWindow -} - -function Call-btnTab4_23{ - -} - -function Call-btnTab4_24{ - -} - -function Call-btnTab4_25{ - -} - -function Call-btnTab4_26{ - -} - - -##*============================================= -##* TAB 4 FUNCTIONS -##*============================================= - - -##*============================================= -##* BUILD TAB 4 BUTTONS IF CONFIGURED -##*============================================= -$ConfigTab4_Name = $ConfigTab4.Name - -$WPFTab4.Header = $ConfigTab4_Name -$WPFlblTab4Section1.Content = $ConfigTab4.section1Label -$WPFlblTab4Section2.Content = $ConfigTab4.section2Label - -$ConfigTab4_btns = $ConfigTab4.button - - -Foreach ($button in $ConfigTab4_btns){ - - [string]$buttonID = $button.id - If ($AppOptionDebugeMode){Write-Host "Tab4: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} - - If ($buttonID -eq "01"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_01.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_01.IsEnabled = $false} Else {$WPFbtnTab4_01.IsEnabled = $true} - $WPFbtnTextTab4_01.Text = $button.Name - $WPFbtnTab4_01.Background = $button.bgcolor - $WPFbtnTab4_01.Foreground = $button.textcolor - #$WPFbtnTab4_01.Add_Click({Call-btnTab4_01}) - $WPFbtnTab4_01.add_Click({ - $ButtonClicked = $WPFbtnTextTab4_01.Text - Call-btnTab4_01 - }) - } - - If ($buttonID -eq "02"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_02.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_02.IsEnabled = $false} Else {$WPFbtnTab4_02.IsEnabled = $true} - $WPFbtnTextTab4_02.Text = $button.Name - $WPFbtnTab4_02.Background = $button.bgcolor - $WPFbtnTab4_02.Foreground = $button.textcolor - $WPFbtnTab4_02.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_02.Text - Call-btnTab4_02 - }) - } - - If ($buttonID -eq "03"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_03.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_03.IsEnabled = $false} Else {$WPFbtnTab4_03.IsEnabled = $true} - $WPFbtnTextTab4_03.Text = $button.Name - $WPFbtnTab4_03.Background = $button.bgcolor - $WPFbtnTab4_03.Foreground = $button.textcolor - $WPFbtnTab4_03.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_03.Text - Call-btnTab4_03 - }) - } - - If ($buttonID -eq "04"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_04.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_04.IsEnabled = $false} Else {$WPFbtnTab4_04.IsEnabled = $true} - $WPFbtnTextTab4_04.Text = $button.Name - $WPFbtnTab4_04.Background = $button.bgcolor - $WPFbtnTab4_04.Foreground = $button.textcolor - $WPFbtnTab4_04.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_04.Text - Call-btnTab4_04 - }) - } - - If ($buttonID -eq "05"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_05.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_05.IsEnabled = $false} Else {$WPFbtnTab4_05.IsEnabled = $true} - $WPFbtnTextTab4_05.Text = $button.Name - $WPFbtnTab4_05.Background = $button.bgcolor - $WPFbtnTab4_05.Foreground = $button.textcolor - $WPFbtnTab4_05.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_05.Text - Call-btnTab4_05 - }) - } - - If ($buttonID -eq "06"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_06.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_06.IsEnabled = $false} Else {$WPFbtnTab4_06.IsEnabled = $true} - $WPFbtnTextTab4_06.Text = $button.Name - $WPFbtnTab4_06.Background = $button.bgcolor - $WPFbtnTab4_06.Foreground = $button.textcolor - $WPFbtnTab4_06.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_06.Text - Call-btnTab4_06 - }) - } - - If ($buttonID -eq "07"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_07.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_07.IsEnabled = $false} Else {$WPFbtnTab4_07.IsEnabled = $true} - $WPFbtnTextTab4_07.Text = $button.Name - $WPFbtnTab4_07.Background = $button.bgcolor - $WPFbtnTab4_07.Foreground = $button.textcolor - $WPFbtnTab4_07.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_07.Text - Call-btnTab4_07 - }) - } - - If ($buttonID -eq "08"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_08.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_08.IsEnabled = $false} Else {$WPFbtnTab4_08.IsEnabled = $true} - $WPFbtnTextTab4_08.Text = $button.Name - $WPFbtnTab4_08.Background = $button.bgcolor - $WPFbtnTab4_08.Foreground = $button.textcolor - $WPFbtnTab4_08.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_08.Text - Call-btnTab4_08 - }) - } - - If ($buttonID -eq "09"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_09.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_09.IsEnabled = $false} Else {$WPFbtnTab4_09.IsEnabled = $true} - $WPFbtnTextTab4_09.Text = $button.Name - $WPFbtnTab4_09.Background = $button.bgcolor - $WPFbtnTab4_09.Foreground = $button.textcolor - $WPFbtnTab4_09.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_09.Text - Call-btnTab4_09 - }) - } - - If ($buttonID -eq "10"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_10.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_10.IsEnabled = $false} Else {$WPFbtnTab4_10.IsEnabled = $true} - $WPFbtnTextTab4_10.Text = $button.Name - $WPFbtnTab4_10.Background = $button.bgcolor - $WPFbtnTab4_10.Foreground = $button.textcolor - $WPFbtnTab4_10.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_10.Text - Call-btnTab4_10 - }) - } - - If ($buttonID -eq "11"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_11.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_11.IsEnabled = $false} Else {$WPFbtnTab4_11.IsEnabled = $true} - $WPFbtnTextTab4_11.Text = $button.Name - $WPFbtnTab4_11.Background = $button.bgcolor - $WPFbtnTab4_11.Foreground = $button.textcolor - $WPFbtnTab4_11.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_11.Text - Call-btnTab4_11 - }) - } - - If ($buttonID -eq "12"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_12.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_12.IsEnabled = $false} Else {$WPFbtnTab4_12.IsEnabled = $true} - $WPFbtnTextTab4_12.Text = $button.Name - $WPFbtnTab4_12.Background = $button.bgcolor - $WPFbtnTab4_12.Foreground = $button.textcolor - $WPFbtnTab4_12.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_12.Text - Call-btnTab4_12 - }) - } - - If ($buttonID -eq "13"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_13.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_13.IsEnabled = $false} Else {$WPFbtnTab4_13.IsEnabled = $true} - $WPFbtnTextTab4_13.Text = $button.Name - $WPFbtnTab4_13.Background = $button.bgcolor - $WPFbtnTab4_13.Foreground = $button.textcolor - $WPFbtnTab4_13.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_13.Text - Call-btnTab4_13 - }) - } - If ($buttonID -eq "14"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_14.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_14.IsEnabled = $false} Else {$WPFbtnTab4_14.IsEnabled = $true} - $WPFbtnTextTab4_14.Text = $button.Name - $WPFbtnTab4_14.Background = $button.bgcolor - $WPFbtnTab4_14.Foreground = $button.textcolor - $WPFbtnTab4_14.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_14.Text - Call-btnTab4_14 - }) - } - - If ($buttonID -eq "15"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_15.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_15.IsEnabled = $false} Else {$WPFbtnTab4_15.IsEnabled = $true} - $WPFbtnTextTab4_15.Text = $button.Name - $WPFbtnTab4_15.Background = $button.bgcolor - $WPFbtnTab4_15.Foreground = $button.textcolor - $WPFbtnTab4_15.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_15.Text - Call-btnTab4_15 - }) - } - - If ($buttonID -eq "16"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_16.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_16.IsEnabled = $false} Else {$WPFbtnTab4_16.IsEnabled = $true} - $WPFbtnTextTab4_16.Text = $button.Name - $WPFbtnTab4_16.Background = $button.bgcolor - $WPFbtnTab4_16.Foreground = $button.textcolor - $WPFbtnTab4_16.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_16.Text - Call-btnTab4_16 - }) - } - - If ($buttonID -eq "17"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_17.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_17.IsEnabled = $false} Else {$WPFbtnTab4_17.IsEnabled = $true} - $WPFbtnTextTab4_17.Text = $button.Name - $WPFbtnTab4_17.Background = $button.bgcolor - $WPFbtnTab4_17.Foreground = $button.textcolor - $WPFbtnTab4_17.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_17.Text - Call-btnTab4_17 - }) - } - - If ($buttonID -eq "18"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_18.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_18.IsEnabled = $false} Else {$WPFbtnTab4_18.IsEnabled = $true} - $WPFbtnTextTab4_18.Text = $button.Name - $WPFbtnTab4_18.Background = $button.bgcolor - $WPFbtnTab4_18.Foreground = $button.textcolor - $WPFbtnTab4_18.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_18.Text - Call-btnTab4_18 - }) - } - - If ($buttonID -eq "19"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_19.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_19.IsEnabled = $false} Else {$WPFbtnTab4_19.IsEnabled = $true} - $WPFbtnTextTab4_19.Text = $button.Name - $WPFbtnTab4_19.Background = $button.bgcolor - $WPFbtnTab4_19.Foreground = $button.textcolor - $WPFbtnTab4_19.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_19.Text - Call-btnTab4_19 - }) - } - - If ($buttonID -eq "20"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_20.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_20.IsEnabled = $false} Else {$WPFbtnTab4_20.IsEnabled = $true} - $WPFbtnTextTab4_20.Text = $button.Name - $WPFbtnTab4_20.Background = $button.bgcolor - $WPFbtnTab4_20.Foreground = $button.textcolor - $WPFbtnTab4_20.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_20.Text - Call-btnTab4_20 - }) - } - - If ($buttonID -eq "21"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_21.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_21.IsEnabled = $false} Else {$WPFbtnTab4_21.IsEnabled = $true} - $WPFbtnTextTab4_21.Text = $button.Name - $WPFbtnTab4_21.Background = $button.bgcolor - $WPFbtnTab4_21.Foreground = $button.textcolor - $WPFbtnTab4_21.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_21.Text - Call-btnTab4_21 - }) - } - - If ($buttonID -eq "22"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_22.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_22.IsEnabled = $false} Else {$WPFbtnTab4_22.IsEnabled = $true} - $WPFbtnTextTab4_22.Text = $button.Name - $WPFbtnTab4_22.Background = $button.bgcolor - $WPFbtnTab4_22.Foreground = $button.textcolor - $WPFbtnTab4_22.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_22.Text - Call-btnTab4_22 - }) - } - - If ($buttonID -eq "23"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_23.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_23.IsEnabled = $false} Else {$WPFbtnTab4_23.IsEnabled = $true} - $WPFbtnTextTab4_23.Text = $button.Name - $WPFbtnTab4_23.Background = $button.bgcolor - $WPFbtnTab4_23.Foreground = $button.textcolor - $WPFbtnTab4_23.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_23.Text - Call-btnTab4_23 - }) - } - - If ($buttonID -eq "24"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_24.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_24.IsEnabled = $false} Else {$WPFbtnTab4_24.IsEnabled = $true} - $WPFbtnTextTab4_24.Text = $button.Name - $WPFbtnTab4_24.Background = $button.bgcolor - $WPFbtnTab4_24.Foreground = $button.textcolor - $WPFbtnTab4_24.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_24.Text - Call-btnTab4_24 - }) - } - - If ($buttonID -eq "25"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_25.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_25.IsEnabled = $false} Else {$WPFbtnTab4_25.IsEnabled = $true} - $WPFbtnTextTab4_25.Text = $button.Name - $WPFbtnTab4_25.Background = $button.bgcolor - $WPFbtnTab4_25.Foreground = $button.textcolor - $WPFbtnTab4_25.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_25.Text - Call-btnTab4_25 - }) - } - - If ($buttonID -eq "26"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab4_26.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab4_26.IsEnabled = $false} Else {$WPFbtnTab4_26.IsEnabled = $true} - $WPFbtnTextTab4_26.Text = $button.Name - $WPFbtnTab4_26.Background = $button.bgcolor - $WPFbtnTab4_26.Foreground = $button.textcolor - $WPFbtnTab4_26.Add_Click({ - $ButtonClicked = $WPFbtnTextTab4_26.Text - Call-btnTab4_26 - }) - } - -} +##*============================================= +##* LOAD TAB 4 FROM CONFIG +##*============================================= +$ConfigTab4 = $AppMenuTabandButtons.tab[3] +If ($HashNames.Keys -eq "Tab4"){ + Write-Host "Found Tab4 section in Names File" -ForegroundColor Gray + $Tab4HashNames = $HashNames.Tab4 + [string]$Tab4HashList = $Tab4HashNames| out-string -stream + write-Host "`nNames found in list: `n$Tab4HashList" +} +Else{ + Write-Host "No Tab4 section found in names file" -ForegroundColor Gray +} +$WPFtxtTab4Name1.Text = "" + +$WPFbtnTab4Name1List.add_Click({Save-ComputerList -TitleDesc "List of Exchange Servers" -TabObject Tab4}) + +$Global:PSExchServer = "http://$($WPFtxtTab4Name1.Text)/PowerShell/" +$Global:PSLync = "http://$($WPFtxtTab4Name1.Text)/ocspowershell" +##*============================================= +##* FORM ADD CLICK FUNCTIONS +##*============================================= +<# + Examples to use (place in function): + + SIMPLE: + Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal + + SEND TO OUTPUT (PASSTHRU): + Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 + $PasstoOutput = Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String + If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} + + OPEN EXTERNAL PS1 + . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") + + USE INTGRATED FUNCTION (EASIEST) + - to log to output box in tab, use -OutputTab switch + - to identify process alias, use -Alias switch, otherwise path will be used instead + - to specify a custom run message use the -CustomRunMsg switch + - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) + - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch + + EXAMPLE (EXE): + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (EXE) with Parameters: + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$env:windir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (PS1): + Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow + +#> +# Set of 6 large buttons under left column +function Call-btnTab4_01{ + +} + +function Call-btnTab4_02{ + +} + +function Call-btnTab4_03{ + +} + +function Call-btnTab4_04{ + +} + +function Call-btnTab4_05{ + +} + +function Call-btnTab4_06{ + +} + +# Set of 4 small buttons under left column +function Call-btnTab4_07{ + +} + +function Call-btnTab4_08{ + +} + + +function Call-btnTab4_09{ + +} + + +function Call-btnTab4_10{ + +} + + +# Set of 4 large buttons under right column +function Call-btnTab4_11{ + Start-ButtonProcess -ProcessCall module -Path "$envProgramFiles\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto;" -OutputTab Tab4 -WindowStyle Normal + +} + +function Call-btnTab4_12{ + +} + +function Call-btnTab4_13{ + +} + +function Call-btnTab4_14{ + +} + +# Set of 12 small buttons under right column +function Call-btnTab4_15{ + +} + +function Call-btnTab4_16{ + +} + +function Call-btnTab4_17{ + Start-ButtonProcess -ProcessCall ps1 -File "ThumbnailPhotoManager.ps1" -OutputTab tab4 -CreateNoWindow +} + +function Call-btnTab4_18{ + Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab4Name1.Text) -OutputTab Tab4 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab4Name1.Text)" -NeverRunAs -WindowStyle Normal +} + +function Call-btnTab4_19{ + Start-ButtonProcess -ProcessCall ps1 -File "Get-ExchangeEnvironmentReport.ps1" -Parameters "-HTMLReport $envUserProfile\Desktop\ExchangeReport.html" -OutputTab tab4 -CreateNoWindow +} + +function Call-btnTab4_20{ + +} + +function Call-btnTab4_21{ + +} + +function Call-btnTab4_22{ + Start-ButtonProcess -ProcessCall ps1 -File "New-ExchangeMailboxAudit-GUI.ps1" -WorkingScriptDirectory "ExchangeMailboxAuditReport\Script" -OutputTab tab4 -CreateNoWindow +} + +function Call-btnTab4_23{ + +} + +function Call-btnTab4_24{ + +} + +function Call-btnTab4_25{ + +} + +function Call-btnTab4_26{ + +} + + +##*============================================= +##* TAB 4 FUNCTIONS +##*============================================= + + +##*============================================= +##* BUILD TAB 4 BUTTONS IF CONFIGURED +##*============================================= +$ConfigTab4_Name = $ConfigTab4.Name + +$WPFTab4.Header = $ConfigTab4_Name +$WPFlblTab4Section1.Content = $ConfigTab4.section1Label +$WPFlblTab4Section2.Content = $ConfigTab4.section2Label + +$ConfigTab4_btns = $ConfigTab4.button + + +Foreach ($button in $ConfigTab4_btns){ + + [string]$buttonID = $button.id + If ($AppOptionDebugeMode){Write-Host "Tab4: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} + + If ($buttonID -eq "01"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_01.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_01.IsEnabled = $false} Else {$WPFbtnTab4_01.IsEnabled = $true} + $WPFbtnTextTab4_01.Text = $button.Name + $WPFbtnTab4_01.Background = $button.bgcolor + $WPFbtnTab4_01.Foreground = $button.textcolor + #$WPFbtnTab4_01.Add_Click({Call-btnTab4_01}) + $WPFbtnTab4_01.add_Click({ + $ButtonClicked = $WPFbtnTextTab4_01.Text + Call-btnTab4_01 + }) + } + + If ($buttonID -eq "02"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_02.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_02.IsEnabled = $false} Else {$WPFbtnTab4_02.IsEnabled = $true} + $WPFbtnTextTab4_02.Text = $button.Name + $WPFbtnTab4_02.Background = $button.bgcolor + $WPFbtnTab4_02.Foreground = $button.textcolor + $WPFbtnTab4_02.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_02.Text + Call-btnTab4_02 + }) + } + + If ($buttonID -eq "03"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_03.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_03.IsEnabled = $false} Else {$WPFbtnTab4_03.IsEnabled = $true} + $WPFbtnTextTab4_03.Text = $button.Name + $WPFbtnTab4_03.Background = $button.bgcolor + $WPFbtnTab4_03.Foreground = $button.textcolor + $WPFbtnTab4_03.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_03.Text + Call-btnTab4_03 + }) + } + + If ($buttonID -eq "04"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_04.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_04.IsEnabled = $false} Else {$WPFbtnTab4_04.IsEnabled = $true} + $WPFbtnTextTab4_04.Text = $button.Name + $WPFbtnTab4_04.Background = $button.bgcolor + $WPFbtnTab4_04.Foreground = $button.textcolor + $WPFbtnTab4_04.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_04.Text + Call-btnTab4_04 + }) + } + + If ($buttonID -eq "05"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_05.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_05.IsEnabled = $false} Else {$WPFbtnTab4_05.IsEnabled = $true} + $WPFbtnTextTab4_05.Text = $button.Name + $WPFbtnTab4_05.Background = $button.bgcolor + $WPFbtnTab4_05.Foreground = $button.textcolor + $WPFbtnTab4_05.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_05.Text + Call-btnTab4_05 + }) + } + + If ($buttonID -eq "06"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_06.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_06.IsEnabled = $false} Else {$WPFbtnTab4_06.IsEnabled = $true} + $WPFbtnTextTab4_06.Text = $button.Name + $WPFbtnTab4_06.Background = $button.bgcolor + $WPFbtnTab4_06.Foreground = $button.textcolor + $WPFbtnTab4_06.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_06.Text + Call-btnTab4_06 + }) + } + + If ($buttonID -eq "07"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_07.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_07.IsEnabled = $false} Else {$WPFbtnTab4_07.IsEnabled = $true} + $WPFbtnTextTab4_07.Text = $button.Name + $WPFbtnTab4_07.Background = $button.bgcolor + $WPFbtnTab4_07.Foreground = $button.textcolor + $WPFbtnTab4_07.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_07.Text + Call-btnTab4_07 + }) + } + + If ($buttonID -eq "08"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_08.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_08.IsEnabled = $false} Else {$WPFbtnTab4_08.IsEnabled = $true} + $WPFbtnTextTab4_08.Text = $button.Name + $WPFbtnTab4_08.Background = $button.bgcolor + $WPFbtnTab4_08.Foreground = $button.textcolor + $WPFbtnTab4_08.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_08.Text + Call-btnTab4_08 + }) + } + + If ($buttonID -eq "09"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_09.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_09.IsEnabled = $false} Else {$WPFbtnTab4_09.IsEnabled = $true} + $WPFbtnTextTab4_09.Text = $button.Name + $WPFbtnTab4_09.Background = $button.bgcolor + $WPFbtnTab4_09.Foreground = $button.textcolor + $WPFbtnTab4_09.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_09.Text + Call-btnTab4_09 + }) + } + + If ($buttonID -eq "10"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_10.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_10.IsEnabled = $false} Else {$WPFbtnTab4_10.IsEnabled = $true} + $WPFbtnTextTab4_10.Text = $button.Name + $WPFbtnTab4_10.Background = $button.bgcolor + $WPFbtnTab4_10.Foreground = $button.textcolor + $WPFbtnTab4_10.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_10.Text + Call-btnTab4_10 + }) + } + + If ($buttonID -eq "11"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_11.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_11.IsEnabled = $false} Else {$WPFbtnTab4_11.IsEnabled = $true} + $WPFbtnTextTab4_11.Text = $button.Name + $WPFbtnTab4_11.Background = $button.bgcolor + $WPFbtnTab4_11.Foreground = $button.textcolor + $WPFbtnTab4_11.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_11.Text + Call-btnTab4_11 + }) + } + + If ($buttonID -eq "12"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_12.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_12.IsEnabled = $false} Else {$WPFbtnTab4_12.IsEnabled = $true} + $WPFbtnTextTab4_12.Text = $button.Name + $WPFbtnTab4_12.Background = $button.bgcolor + $WPFbtnTab4_12.Foreground = $button.textcolor + $WPFbtnTab4_12.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_12.Text + Call-btnTab4_12 + }) + } + + If ($buttonID -eq "13"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_13.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_13.IsEnabled = $false} Else {$WPFbtnTab4_13.IsEnabled = $true} + $WPFbtnTextTab4_13.Text = $button.Name + $WPFbtnTab4_13.Background = $button.bgcolor + $WPFbtnTab4_13.Foreground = $button.textcolor + $WPFbtnTab4_13.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_13.Text + Call-btnTab4_13 + }) + } + If ($buttonID -eq "14"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_14.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_14.IsEnabled = $false} Else {$WPFbtnTab4_14.IsEnabled = $true} + $WPFbtnTextTab4_14.Text = $button.Name + $WPFbtnTab4_14.Background = $button.bgcolor + $WPFbtnTab4_14.Foreground = $button.textcolor + $WPFbtnTab4_14.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_14.Text + Call-btnTab4_14 + }) + } + + If ($buttonID -eq "15"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_15.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_15.IsEnabled = $false} Else {$WPFbtnTab4_15.IsEnabled = $true} + $WPFbtnTextTab4_15.Text = $button.Name + $WPFbtnTab4_15.Background = $button.bgcolor + $WPFbtnTab4_15.Foreground = $button.textcolor + $WPFbtnTab4_15.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_15.Text + Call-btnTab4_15 + }) + } + + If ($buttonID -eq "16"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_16.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_16.IsEnabled = $false} Else {$WPFbtnTab4_16.IsEnabled = $true} + $WPFbtnTextTab4_16.Text = $button.Name + $WPFbtnTab4_16.Background = $button.bgcolor + $WPFbtnTab4_16.Foreground = $button.textcolor + $WPFbtnTab4_16.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_16.Text + Call-btnTab4_16 + }) + } + + If ($buttonID -eq "17"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_17.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_17.IsEnabled = $false} Else {$WPFbtnTab4_17.IsEnabled = $true} + $WPFbtnTextTab4_17.Text = $button.Name + $WPFbtnTab4_17.Background = $button.bgcolor + $WPFbtnTab4_17.Foreground = $button.textcolor + $WPFbtnTab4_17.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_17.Text + Call-btnTab4_17 + }) + } + + If ($buttonID -eq "18"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_18.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_18.IsEnabled = $false} Else {$WPFbtnTab4_18.IsEnabled = $true} + $WPFbtnTextTab4_18.Text = $button.Name + $WPFbtnTab4_18.Background = $button.bgcolor + $WPFbtnTab4_18.Foreground = $button.textcolor + $WPFbtnTab4_18.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_18.Text + Call-btnTab4_18 + }) + } + + If ($buttonID -eq "19"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_19.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_19.IsEnabled = $false} Else {$WPFbtnTab4_19.IsEnabled = $true} + $WPFbtnTextTab4_19.Text = $button.Name + $WPFbtnTab4_19.Background = $button.bgcolor + $WPFbtnTab4_19.Foreground = $button.textcolor + $WPFbtnTab4_19.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_19.Text + Call-btnTab4_19 + }) + } + + If ($buttonID -eq "20"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_20.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_20.IsEnabled = $false} Else {$WPFbtnTab4_20.IsEnabled = $true} + $WPFbtnTextTab4_20.Text = $button.Name + $WPFbtnTab4_20.Background = $button.bgcolor + $WPFbtnTab4_20.Foreground = $button.textcolor + $WPFbtnTab4_20.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_20.Text + Call-btnTab4_20 + }) + } + + If ($buttonID -eq "21"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_21.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_21.IsEnabled = $false} Else {$WPFbtnTab4_21.IsEnabled = $true} + $WPFbtnTextTab4_21.Text = $button.Name + $WPFbtnTab4_21.Background = $button.bgcolor + $WPFbtnTab4_21.Foreground = $button.textcolor + $WPFbtnTab4_21.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_21.Text + Call-btnTab4_21 + }) + } + + If ($buttonID -eq "22"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_22.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_22.IsEnabled = $false} Else {$WPFbtnTab4_22.IsEnabled = $true} + $WPFbtnTextTab4_22.Text = $button.Name + $WPFbtnTab4_22.Background = $button.bgcolor + $WPFbtnTab4_22.Foreground = $button.textcolor + $WPFbtnTab4_22.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_22.Text + Call-btnTab4_22 + }) + } + + If ($buttonID -eq "23"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_23.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_23.IsEnabled = $false} Else {$WPFbtnTab4_23.IsEnabled = $true} + $WPFbtnTextTab4_23.Text = $button.Name + $WPFbtnTab4_23.Background = $button.bgcolor + $WPFbtnTab4_23.Foreground = $button.textcolor + $WPFbtnTab4_23.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_23.Text + Call-btnTab4_23 + }) + } + + If ($buttonID -eq "24"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_24.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_24.IsEnabled = $false} Else {$WPFbtnTab4_24.IsEnabled = $true} + $WPFbtnTextTab4_24.Text = $button.Name + $WPFbtnTab4_24.Background = $button.bgcolor + $WPFbtnTab4_24.Foreground = $button.textcolor + $WPFbtnTab4_24.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_24.Text + Call-btnTab4_24 + }) + } + + If ($buttonID -eq "25"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_25.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_25.IsEnabled = $false} Else {$WPFbtnTab4_25.IsEnabled = $true} + $WPFbtnTextTab4_25.Text = $button.Name + $WPFbtnTab4_25.Background = $button.bgcolor + $WPFbtnTab4_25.Foreground = $button.textcolor + $WPFbtnTab4_25.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_25.Text + Call-btnTab4_25 + }) + } + + If ($buttonID -eq "26"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab4_26.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab4_26.IsEnabled = $false} Else {$WPFbtnTab4_26.IsEnabled = $true} + $WPFbtnTextTab4_26.Text = $button.Name + $WPFbtnTab4_26.Background = $button.bgcolor + $WPFbtnTab4_26.Foreground = $button.textcolor + $WPFbtnTab4_26.Add_Click({ + $ButtonClicked = $WPFbtnTextTab4_26.Text + Call-btnTab4_26 + }) + } + +} If ($ConfigTab4.enable -eq "false"){$WPFTab4.Visibility = 'Hidden'} Else {$WPFTab4.Visibility = 'Visible'} \ No newline at end of file diff --git a/App/Extensions/TabControl/AdminMenu-Tab5.ps1 b/Extensions/TabControl/AdminMenu-Tab5.ps1 similarity index 96% rename from App/Extensions/TabControl/AdminMenu-Tab5.ps1 rename to Extensions/TabControl/AdminMenu-Tab5.ps1 index e08a766..10945f8 100644 --- a/App/Extensions/TabControl/AdminMenu-Tab5.ps1 +++ b/Extensions/TabControl/AdminMenu-Tab5.ps1 @@ -1,548 +1,548 @@ -##*============================================= -##* LOAD TAB 2 FROM CONFIG -##*============================================= -$ConfigTab5 = $AppMenuTabandButtons.tab[4] -If ($HashNames.Keys -eq "Tab5"){ - Write-Host "Found Tab5 section in Names File" -ForegroundColor Gray - $Tab5HashNames = $HashNames.Tab5 - [string]$Tab5HashList = $Tab5HashNames| out-string -stream - write-Host "`nNames found in list: `n$Tab5HashList" -} -Else{ - Write-Host "No Tab5 section found in names file" -ForegroundColor Gray -} - -$WPFbtnTab5Name1List.add_Click({Save-ComputerList -TitleDesc "List of Hosts" -TabObject Tab5}) -##*============================================= -##* FORM ADD CLICK FUNCTIONS -##*============================================= -<# - Examples to use (place in function): - - SIMPLE: - Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal - - SEND TO OUTPUT (PASSTHRU): - Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 - $PasstoOutput = Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String - If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} - - OPEN EXTERNAL PS1 - . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") - - USE INTGRATED FUNCTION (EASIEST) - - to log to output box in tab, use -OutputTab switch - - to identify process alias, use -Alias switch, otherwise path will be used instead - - to specify a custom run message use the -CustomRunMsg switch - - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) - - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch - - EXAMPLE (EXE): - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (EXE) with Parameters: - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$env:windir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (PS1): - Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow - -#> -# Set of 6 large buttons under left column -function Call-btnTab5_01{ - $VPX = "$envProgramFilesX86\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe" - Start-ButtonProcess -Path $VPX -OutputTab Tab5 -WindowStyle Normal -} - -function Call-btnTab5_02{ - $VMM = "$envProgramFiles\Microsoft System Center 2012 Virtual Machine Manager\bin\VmmAdminUI.exe" - Start-ButtonProcess -Path $VMM -OutputTab Tab5 -WindowStyle Normal -} - -function Call-btnTab5_03{ - $NetAppSysMgr = "$envProgramFiles\NetApp\OnCommand System Manager\SystemManager.exe" - Start-ButtonProcess -Path $NetAppSysMgr -OutputTab Tab5 -WindowStyle Normal -} - -function Call-btnTab5_04{ - -} - -function Call-btnTab5_05{ - -} - -function Call-btnTab5_06{ - -} - -# Set of 4 small buttons under left column -function Call-btnTab5_07{ - Start-ButtonProcess -Path "%windir%\System32\virtmgmt.msc" -OutputTab Tab5 -WindowStyle Normal -} - -function Call-btnTab5_08{ - -} - - -function Call-btnTab5_09{ - -} - - -function Call-btnTab5_10{ - -} - - -# Set of 4 large buttons under right column -function Call-btnTab5_11{ - -} - -function Call-btnTab5_12{ - -} - -function Call-btnTab5_13{ - -} - -function Call-btnTab5_14{ - -} - -# Set of 12 small buttons under right column -function Call-btnTab5_15{ - Start-ButtonProcess -Path "$envProgramFilesX86\VMware\VMware Horizon View Client\vmware-view.exe" -OutputTab Tab5 -WindowStyle Normal -} - -function Call-btnTab5_16{ - -} - -function Call-btnTab5_17{ - -} - -function Call-btnTab5_18{ - Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab5Name1.Text) -OutputTab Tab4 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab5Name1.Text)" -NeverRunAs -WindowStyle Normal -} - -function Call-btnTab5_19{ - -} - -function Call-btnTab5_20{ - -} - -function Call-btnTab5_21{ - -} - -function Call-btnTab5_22{ - If (Test-Path "$envWinDir\system32\putty.exe"){ - $PuttyPath = "$envWinDir\system32\putty.exe" - } - If (Test-Path $PuttyPath){ - $PuttyPath = "$UtilPath\putty.exe" - } - Else{ - $PuttyPath = "$UtilPath\putty.exe" - } - - If (!$WPFtxtTab5Name1.Text){ - Start-ButtonProcess -ProcessCall exe -FilePath $PuttyPath -CustomRunMsg "Opening [$ButtonClicked], change host and try again to connnect $ButtonClicked to a host'." -OutputTab tab5 -WindowStyle Normal - } - Else{ - If (Test-Connection -ComputerName $WPFtxtTab1Name1.Text -Quiet){ - Start-ButtonProcess -ProcessCall exe -FilePath $PuttyPath -Parameters $WPFtxtTab5Name1.Text -CustomRunMsg "connecting [$ButtonClicked] to: $($WPFtxtTab5Name1.Text)" -OutputTab Tab5 -WindowStyle Normal - } - Else { - Write-OutputBox -OutputBoxMessage "Unable to ping host: $($WPFtxtTab5Name1.Text), host may be offline." -Type "ERROR: " -Object Tab5 - } - } -} - -function Call-btnTab5_23{ - -} - -function Call-btnTab5_24{ - -} - -function Call-btnTab5_25{ - -} - -function Call-btnTab5_26{ - -} - - -##*============================================= -##* TAB 1 OTHER FUNCTIONS -##*============================================= - -$WPFtxtTab5Name1.Text = "" - - -##*============================================= -##* BUILD TAB 1 BUTTONS IF CONFIGURED -##*============================================= -$ConfigTab5_Name = $ConfigTab5.Name - -$WPFTab5.Header = $ConfigTab5_Name -$WPFlblTab5Section1.Content = $ConfigTab5.section1Label -$WPFlblTab5Section2.Content = $ConfigTab5.section2Label - -$ConfigTab5_btns = $ConfigTab5.button - - -Foreach ($button in $ConfigTab5_btns){ - - [string]$buttonID = $button.id - If ($AppOptionDebugeMode){Write-Host "Tab5: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} - - If ($buttonID -eq "01"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_01.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_01.IsEnabled = $false} Else {$WPFbtnTab5_01.IsEnabled = $true} - $WPFbtnTextTab5_01.Text = $button.Name - $WPFbtnTab5_01.Background = $button.bgcolor - $WPFbtnTab5_01.Foreground = $button.textcolor - #$WPFbtnTab5_01.Add_Click({Call-btnTab5_01}) - $WPFbtnTab5_01.add_Click({ - $ButtonClicked = $WPFbtnTextTab5_01.Text - Call-btnTab5_01 - }) - } - - If ($buttonID -eq "02"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_02.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_02.IsEnabled = $false} Else {$WPFbtnTab5_02.IsEnabled = $true} - $WPFbtnTextTab5_02.Text = $button.Name - $WPFbtnTab5_02.Background = $button.bgcolor - $WPFbtnTab5_02.Foreground = $button.textcolor - $WPFbtnTab5_02.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_02.Text - Call-btnTab5_02 - }) - } - - If ($buttonID -eq "03"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_03.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_03.IsEnabled = $false} Else {$WPFbtnTab5_03.IsEnabled = $true} - $WPFbtnTextTab5_03.Text = $button.Name - $WPFbtnTab5_03.Background = $button.bgcolor - $WPFbtnTab5_03.Foreground = $button.textcolor - $WPFbtnTab5_03.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_03.Text - Call-btnTab5_03 - }) - } - - If ($buttonID -eq "04"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_04.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_04.IsEnabled = $false} Else {$WPFbtnTab5_04.IsEnabled = $true} - $WPFbtnTextTab5_04.Text = $button.Name - $WPFbtnTab5_04.Background = $button.bgcolor - $WPFbtnTab5_04.Foreground = $button.textcolor - $WPFbtnTab5_04.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_04.Text - Call-btnTab5_04 - }) - } - - If ($buttonID -eq "05"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_05.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_05.IsEnabled = $false} Else {$WPFbtnTab5_05.IsEnabled = $true} - $WPFbtnTextTab5_05.Text = $button.Name - $WPFbtnTab5_05.Background = $button.bgcolor - $WPFbtnTab5_05.Foreground = $button.textcolor - $WPFbtnTab5_05.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_05.Text - Call-btnTab5_05 - }) - } - - If ($buttonID -eq "06"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_06.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_06.IsEnabled = $false} Else {$WPFbtnTab5_06.IsEnabled = $true} - $WPFbtnTextTab5_06.Text = $button.Name - $WPFbtnTab5_06.Background = $button.bgcolor - $WPFbtnTab5_06.Foreground = $button.textcolor - $WPFbtnTab5_06.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_06.Text - Call-btnTab5_06 - }) - } - - If ($buttonID -eq "07"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_07.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_07.IsEnabled = $false} Else {$WPFbtnTab5_07.IsEnabled = $true} - $WPFbtnTextTab5_07.Text = $button.Name - $WPFbtnTab5_07.Background = $button.bgcolor - $WPFbtnTab5_07.Foreground = $button.textcolor - $WPFbtnTab5_07.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_07.Text - Call-btnTab5_07 - }) - } - - If ($buttonID -eq "08"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_08.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_08.IsEnabled = $false} Else {$WPFbtnTab5_08.IsEnabled = $true} - $WPFbtnTextTab5_08.Text = $button.Name - $WPFbtnTab5_08.Background = $button.bgcolor - $WPFbtnTab5_08.Foreground = $button.textcolor - $WPFbtnTab5_08.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_08.Text - Call-btnTab5_08 - }) - } - - If ($buttonID -eq "09"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_09.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_09.IsEnabled = $false} Else {$WPFbtnTab5_09.IsEnabled = $true} - $WPFbtnTextTab5_09.Text = $button.Name - $WPFbtnTab5_09.Background = $button.bgcolor - $WPFbtnTab5_09.Foreground = $button.textcolor - $WPFbtnTab5_09.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_09.Text - Call-btnTab5_09 - }) - } - - If ($buttonID -eq "10"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_10.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_10.IsEnabled = $false} Else {$WPFbtnTab5_10.IsEnabled = $true} - $WPFbtnTextTab5_10.Text = $button.Name - $WPFbtnTab5_10.Background = $button.bgcolor - $WPFbtnTab5_10.Foreground = $button.textcolor - $WPFbtnTab5_10.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_10.Text - Call-btnTab5_10 - }) - } - - If ($buttonID -eq "11"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_11.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_11.IsEnabled = $false} Else {$WPFbtnTab5_11.IsEnabled = $true} - $WPFbtnTextTab5_11.Text = $button.Name - $WPFbtnTab5_11.Background = $button.bgcolor - $WPFbtnTab5_11.Foreground = $button.textcolor - $WPFbtnTab5_11.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_11.Text - Call-btnTab5_11 - }) - } - - If ($buttonID -eq "12"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_12.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_12.IsEnabled = $false} Else {$WPFbtnTab5_12.IsEnabled = $true} - $WPFbtnTextTab5_12.Text = $button.Name - $WPFbtnTab5_12.Background = $button.bgcolor - $WPFbtnTab5_12.Foreground = $button.textcolor - $WPFbtnTab5_12.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_12.Text - Call-btnTab5_12 - }) - } - - If ($buttonID -eq "13"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_13.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_13.IsEnabled = $false} Else {$WPFbtnTab5_13.IsEnabled = $true} - $WPFbtnTextTab5_13.Text = $button.Name - $WPFbtnTab5_13.Background = $button.bgcolor - $WPFbtnTab5_13.Foreground = $button.textcolor - $WPFbtnTab5_13.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_13.Text - Call-btnTab5_13 - }) - } - If ($buttonID -eq "14"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_14.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_14.IsEnabled = $false} Else {$WPFbtnTab5_14.IsEnabled = $true} - $WPFbtnTextTab5_14.Text = $button.Name - $WPFbtnTab5_14.Background = $button.bgcolor - $WPFbtnTab5_14.Foreground = $button.textcolor - $WPFbtnTab5_14.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_14.Text - Call-btnTab5_14 - }) - } - - If ($buttonID -eq "15"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_15.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_15.IsEnabled = $false} Else {$WPFbtnTab5_15.IsEnabled = $true} - $WPFbtnTextTab5_15.Text = $button.Name - $WPFbtnTab5_15.Background = $button.bgcolor - $WPFbtnTab5_15.Foreground = $button.textcolor - $WPFbtnTab5_15.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_15.Text - Call-btnTab5_15 - }) - } - - If ($buttonID -eq "16"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_16.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_16.IsEnabled = $false} Else {$WPFbtnTab5_16.IsEnabled = $true} - $WPFbtnTextTab5_16.Text = $button.Name - $WPFbtnTab5_16.Background = $button.bgcolor - $WPFbtnTab5_16.Foreground = $button.textcolor - $WPFbtnTab5_16.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_16.Text - Call-btnTab5_16 - }) - } - - If ($buttonID -eq "17"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_17.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_17.IsEnabled = $false} Else {$WPFbtnTab5_17.IsEnabled = $true} - $WPFbtnTextTab5_17.Text = $button.Name - $WPFbtnTab5_17.Background = $button.bgcolor - $WPFbtnTab5_17.Foreground = $button.textcolor - $WPFbtnTab5_17.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_17.Text - Call-btnTab5_17 - }) - } - - If ($buttonID -eq "18"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_18.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_18.IsEnabled = $false} Else {$WPFbtnTab5_18.IsEnabled = $true} - $WPFbtnTextTab5_18.Text = $button.Name - $WPFbtnTab5_18.Background = $button.bgcolor - $WPFbtnTab5_18.Foreground = $button.textcolor - $WPFbtnTab5_18.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_18.Text - Call-btnTab5_18 - }) - } - - If ($buttonID -eq "19"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_19.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_19.IsEnabled = $false} Else {$WPFbtnTab5_19.IsEnabled = $true} - $WPFbtnTextTab5_19.Text = $button.Name - $WPFbtnTab5_19.Background = $button.bgcolor - $WPFbtnTab5_19.Foreground = $button.textcolor - $WPFbtnTab5_19.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_19.Text - Call-btnTab5_19 - }) - } - - If ($buttonID -eq "20"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_20.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_20.IsEnabled = $false} Else {$WPFbtnTab5_20.IsEnabled = $true} - $WPFbtnTextTab5_20.Text = $button.Name - $WPFbtnTab5_20.Background = $button.bgcolor - $WPFbtnTab5_20.Foreground = $button.textcolor - $WPFbtnTab5_20.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_20.Text - Call-btnTab5_20 - }) - } - - If ($buttonID -eq "21"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_21.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_21.IsEnabled = $false} Else {$WPFbtnTab5_21.IsEnabled = $true} - $WPFbtnTextTab5_21.Text = $button.Name - $WPFbtnTab5_21.Background = $button.bgcolor - $WPFbtnTab5_21.Foreground = $button.textcolor - $WPFbtnTab5_21.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_21.Text - Call-btnTab5_21 - }) - } - - If ($buttonID -eq "22"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_22.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_22.IsEnabled = $false} Else {$WPFbtnTab5_22.IsEnabled = $true} - $WPFbtnTextTab5_22.Text = $button.Name - $WPFbtnTab5_22.Background = $button.bgcolor - $WPFbtnTab5_22.Foreground = $button.textcolor - $WPFbtnTab5_22.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_22.Text - Call-btnTab5_22 - }) - } - - If ($buttonID -eq "23"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_23.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_23.IsEnabled = $false} Else {$WPFbtnTab5_23.IsEnabled = $true} - $WPFbtnTextTab5_23.Text = $button.Name - $WPFbtnTab5_23.Background = $button.bgcolor - $WPFbtnTab5_23.Foreground = $button.textcolor - $WPFbtnTab5_23.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_23.Text - Call-btnTab5_23 - }) - } - - If ($buttonID -eq "24"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_24.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_24.IsEnabled = $false} Else {$WPFbtnTab5_24.IsEnabled = $true} - $WPFbtnTextTab5_24.Text = $button.Name - $WPFbtnTab5_24.Background = $button.bgcolor - $WPFbtnTab5_24.Foreground = $button.textcolor - $WPFbtnTab5_24.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_24.Text - Call-btnTab5_24 - }) - } - - If ($buttonID -eq "25"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_25.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_25.IsEnabled = $false} Else {$WPFbtnTab5_25.IsEnabled = $true} - $WPFbtnTextTab5_25.Text = $button.Name - $WPFbtnTab5_25.Background = $button.bgcolor - $WPFbtnTab5_25.Foreground = $button.textcolor - $WPFbtnTab5_25.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_25.Text - Call-btnTab5_25 - }) - } - - If ($buttonID -eq "26"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab5_26.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab5_26.IsEnabled = $false} Else {$WPFbtnTab5_26.IsEnabled = $true} - $WPFbtnTextTab5_26.Text = $button.Name - $WPFbtnTab5_26.Background = $button.bgcolor - $WPFbtnTab5_26.Foreground = $button.textcolor - $WPFbtnTab5_26.Add_Click({ - $ButtonClicked = $WPFbtnTextTab5_26.Text - Call-btnTab5_26 - }) - } - -} +##*============================================= +##* LOAD TAB 2 FROM CONFIG +##*============================================= +$ConfigTab5 = $AppMenuTabandButtons.tab[4] +If ($HashNames.Keys -eq "Tab5"){ + Write-Host "Found Tab5 section in Names File" -ForegroundColor Gray + $Tab5HashNames = $HashNames.Tab5 + [string]$Tab5HashList = $Tab5HashNames| out-string -stream + write-Host "`nNames found in list: `n$Tab5HashList" +} +Else{ + Write-Host "No Tab5 section found in names file" -ForegroundColor Gray +} + +$WPFbtnTab5Name1List.add_Click({Save-ComputerList -TitleDesc "List of Hosts" -TabObject Tab5}) +##*============================================= +##* FORM ADD CLICK FUNCTIONS +##*============================================= +<# + Examples to use (place in function): + + SIMPLE: + Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal + + SEND TO OUTPUT (PASSTHRU): + Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 + $PasstoOutput = Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String + If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} + + OPEN EXTERNAL PS1 + . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") + + USE INTGRATED FUNCTION (EASIEST) + - to log to output box in tab, use -OutputTab switch + - to identify process alias, use -Alias switch, otherwise path will be used instead + - to specify a custom run message use the -CustomRunMsg switch + - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) + - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch + + EXAMPLE (EXE): + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (EXE) with Parameters: + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$env:windir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (PS1): + Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow + +#> +# Set of 6 large buttons under left column +function Call-btnTab5_01{ + $VPX = "$envProgramFilesX86\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe" + Start-ButtonProcess -Path $VPX -OutputTab Tab5 -WindowStyle Normal +} + +function Call-btnTab5_02{ + $VMM = "$envProgramFiles\Microsoft System Center 2012 Virtual Machine Manager\bin\VmmAdminUI.exe" + Start-ButtonProcess -Path $VMM -OutputTab Tab5 -WindowStyle Normal +} + +function Call-btnTab5_03{ + $NetAppSysMgr = "$envProgramFiles\NetApp\OnCommand System Manager\SystemManager.exe" + Start-ButtonProcess -Path $NetAppSysMgr -OutputTab Tab5 -WindowStyle Normal +} + +function Call-btnTab5_04{ + +} + +function Call-btnTab5_05{ + +} + +function Call-btnTab5_06{ + +} + +# Set of 4 small buttons under left column +function Call-btnTab5_07{ + Start-ButtonProcess -Path "%windir%\System32\virtmgmt.msc" -OutputTab Tab5 -WindowStyle Normal +} + +function Call-btnTab5_08{ + +} + + +function Call-btnTab5_09{ + +} + + +function Call-btnTab5_10{ + +} + + +# Set of 4 large buttons under right column +function Call-btnTab5_11{ + +} + +function Call-btnTab5_12{ + +} + +function Call-btnTab5_13{ + +} + +function Call-btnTab5_14{ + +} + +# Set of 12 small buttons under right column +function Call-btnTab5_15{ + Start-ButtonProcess -Path "$envProgramFilesX86\VMware\VMware Horizon View Client\vmware-view.exe" -OutputTab Tab5 -WindowStyle Normal +} + +function Call-btnTab5_16{ + +} + +function Call-btnTab5_17{ + +} + +function Call-btnTab5_18{ + Start-ButtonProcess -Path "$envWinDir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtTab5Name1.Text) -OutputTab Tab4 -CustomRunMsg "Opening Remote Desktop Connection for: $($WPFtxtTab5Name1.Text)" -NeverRunAs -WindowStyle Normal +} + +function Call-btnTab5_19{ + +} + +function Call-btnTab5_20{ + +} + +function Call-btnTab5_21{ + +} + +function Call-btnTab5_22{ + If (Test-Path "$envWinDir\system32\putty.exe"){ + $PuttyPath = "$envWinDir\system32\putty.exe" + } + If (Test-Path $PuttyPath){ + $PuttyPath = "$UtilPath\putty.exe" + } + Else{ + $PuttyPath = "$UtilPath\putty.exe" + } + + If (!$WPFtxtTab5Name1.Text){ + Start-ButtonProcess -ProcessCall exe -FilePath $PuttyPath -CustomRunMsg "Opening [$ButtonClicked], change host and try again to connnect $ButtonClicked to a host'." -OutputTab tab5 -WindowStyle Normal + } + Else{ + If (Test-Connection -ComputerName $WPFtxtTab1Name1.Text -Quiet){ + Start-ButtonProcess -ProcessCall exe -FilePath $PuttyPath -Parameters $WPFtxtTab5Name1.Text -CustomRunMsg "connecting [$ButtonClicked] to: $($WPFtxtTab5Name1.Text)" -OutputTab Tab5 -WindowStyle Normal + } + Else { + Write-OutputBox -OutputBoxMessage "Unable to ping host: $($WPFtxtTab5Name1.Text), host may be offline." -Type "ERROR: " -Object Tab5 + } + } +} + +function Call-btnTab5_23{ + +} + +function Call-btnTab5_24{ + +} + +function Call-btnTab5_25{ + +} + +function Call-btnTab5_26{ + +} + + +##*============================================= +##* TAB 1 OTHER FUNCTIONS +##*============================================= + +$WPFtxtTab5Name1.Text = "" + + +##*============================================= +##* BUILD TAB 1 BUTTONS IF CONFIGURED +##*============================================= +$ConfigTab5_Name = $ConfigTab5.Name + +$WPFTab5.Header = $ConfigTab5_Name +$WPFlblTab5Section1.Content = $ConfigTab5.section1Label +$WPFlblTab5Section2.Content = $ConfigTab5.section2Label + +$ConfigTab5_btns = $ConfigTab5.button + + +Foreach ($button in $ConfigTab5_btns){ + + [string]$buttonID = $button.id + If ($AppOptionDebugeMode){Write-Host "Tab5: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} + + If ($buttonID -eq "01"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_01.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_01.IsEnabled = $false} Else {$WPFbtnTab5_01.IsEnabled = $true} + $WPFbtnTextTab5_01.Text = $button.Name + $WPFbtnTab5_01.Background = $button.bgcolor + $WPFbtnTab5_01.Foreground = $button.textcolor + #$WPFbtnTab5_01.Add_Click({Call-btnTab5_01}) + $WPFbtnTab5_01.add_Click({ + $ButtonClicked = $WPFbtnTextTab5_01.Text + Call-btnTab5_01 + }) + } + + If ($buttonID -eq "02"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_02.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_02.IsEnabled = $false} Else {$WPFbtnTab5_02.IsEnabled = $true} + $WPFbtnTextTab5_02.Text = $button.Name + $WPFbtnTab5_02.Background = $button.bgcolor + $WPFbtnTab5_02.Foreground = $button.textcolor + $WPFbtnTab5_02.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_02.Text + Call-btnTab5_02 + }) + } + + If ($buttonID -eq "03"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_03.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_03.IsEnabled = $false} Else {$WPFbtnTab5_03.IsEnabled = $true} + $WPFbtnTextTab5_03.Text = $button.Name + $WPFbtnTab5_03.Background = $button.bgcolor + $WPFbtnTab5_03.Foreground = $button.textcolor + $WPFbtnTab5_03.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_03.Text + Call-btnTab5_03 + }) + } + + If ($buttonID -eq "04"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_04.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_04.IsEnabled = $false} Else {$WPFbtnTab5_04.IsEnabled = $true} + $WPFbtnTextTab5_04.Text = $button.Name + $WPFbtnTab5_04.Background = $button.bgcolor + $WPFbtnTab5_04.Foreground = $button.textcolor + $WPFbtnTab5_04.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_04.Text + Call-btnTab5_04 + }) + } + + If ($buttonID -eq "05"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_05.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_05.IsEnabled = $false} Else {$WPFbtnTab5_05.IsEnabled = $true} + $WPFbtnTextTab5_05.Text = $button.Name + $WPFbtnTab5_05.Background = $button.bgcolor + $WPFbtnTab5_05.Foreground = $button.textcolor + $WPFbtnTab5_05.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_05.Text + Call-btnTab5_05 + }) + } + + If ($buttonID -eq "06"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_06.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_06.IsEnabled = $false} Else {$WPFbtnTab5_06.IsEnabled = $true} + $WPFbtnTextTab5_06.Text = $button.Name + $WPFbtnTab5_06.Background = $button.bgcolor + $WPFbtnTab5_06.Foreground = $button.textcolor + $WPFbtnTab5_06.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_06.Text + Call-btnTab5_06 + }) + } + + If ($buttonID -eq "07"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_07.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_07.IsEnabled = $false} Else {$WPFbtnTab5_07.IsEnabled = $true} + $WPFbtnTextTab5_07.Text = $button.Name + $WPFbtnTab5_07.Background = $button.bgcolor + $WPFbtnTab5_07.Foreground = $button.textcolor + $WPFbtnTab5_07.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_07.Text + Call-btnTab5_07 + }) + } + + If ($buttonID -eq "08"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_08.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_08.IsEnabled = $false} Else {$WPFbtnTab5_08.IsEnabled = $true} + $WPFbtnTextTab5_08.Text = $button.Name + $WPFbtnTab5_08.Background = $button.bgcolor + $WPFbtnTab5_08.Foreground = $button.textcolor + $WPFbtnTab5_08.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_08.Text + Call-btnTab5_08 + }) + } + + If ($buttonID -eq "09"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_09.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_09.IsEnabled = $false} Else {$WPFbtnTab5_09.IsEnabled = $true} + $WPFbtnTextTab5_09.Text = $button.Name + $WPFbtnTab5_09.Background = $button.bgcolor + $WPFbtnTab5_09.Foreground = $button.textcolor + $WPFbtnTab5_09.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_09.Text + Call-btnTab5_09 + }) + } + + If ($buttonID -eq "10"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_10.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_10.IsEnabled = $false} Else {$WPFbtnTab5_10.IsEnabled = $true} + $WPFbtnTextTab5_10.Text = $button.Name + $WPFbtnTab5_10.Background = $button.bgcolor + $WPFbtnTab5_10.Foreground = $button.textcolor + $WPFbtnTab5_10.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_10.Text + Call-btnTab5_10 + }) + } + + If ($buttonID -eq "11"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_11.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_11.IsEnabled = $false} Else {$WPFbtnTab5_11.IsEnabled = $true} + $WPFbtnTextTab5_11.Text = $button.Name + $WPFbtnTab5_11.Background = $button.bgcolor + $WPFbtnTab5_11.Foreground = $button.textcolor + $WPFbtnTab5_11.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_11.Text + Call-btnTab5_11 + }) + } + + If ($buttonID -eq "12"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_12.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_12.IsEnabled = $false} Else {$WPFbtnTab5_12.IsEnabled = $true} + $WPFbtnTextTab5_12.Text = $button.Name + $WPFbtnTab5_12.Background = $button.bgcolor + $WPFbtnTab5_12.Foreground = $button.textcolor + $WPFbtnTab5_12.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_12.Text + Call-btnTab5_12 + }) + } + + If ($buttonID -eq "13"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_13.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_13.IsEnabled = $false} Else {$WPFbtnTab5_13.IsEnabled = $true} + $WPFbtnTextTab5_13.Text = $button.Name + $WPFbtnTab5_13.Background = $button.bgcolor + $WPFbtnTab5_13.Foreground = $button.textcolor + $WPFbtnTab5_13.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_13.Text + Call-btnTab5_13 + }) + } + If ($buttonID -eq "14"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_14.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_14.IsEnabled = $false} Else {$WPFbtnTab5_14.IsEnabled = $true} + $WPFbtnTextTab5_14.Text = $button.Name + $WPFbtnTab5_14.Background = $button.bgcolor + $WPFbtnTab5_14.Foreground = $button.textcolor + $WPFbtnTab5_14.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_14.Text + Call-btnTab5_14 + }) + } + + If ($buttonID -eq "15"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_15.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_15.IsEnabled = $false} Else {$WPFbtnTab5_15.IsEnabled = $true} + $WPFbtnTextTab5_15.Text = $button.Name + $WPFbtnTab5_15.Background = $button.bgcolor + $WPFbtnTab5_15.Foreground = $button.textcolor + $WPFbtnTab5_15.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_15.Text + Call-btnTab5_15 + }) + } + + If ($buttonID -eq "16"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_16.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_16.IsEnabled = $false} Else {$WPFbtnTab5_16.IsEnabled = $true} + $WPFbtnTextTab5_16.Text = $button.Name + $WPFbtnTab5_16.Background = $button.bgcolor + $WPFbtnTab5_16.Foreground = $button.textcolor + $WPFbtnTab5_16.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_16.Text + Call-btnTab5_16 + }) + } + + If ($buttonID -eq "17"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_17.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_17.IsEnabled = $false} Else {$WPFbtnTab5_17.IsEnabled = $true} + $WPFbtnTextTab5_17.Text = $button.Name + $WPFbtnTab5_17.Background = $button.bgcolor + $WPFbtnTab5_17.Foreground = $button.textcolor + $WPFbtnTab5_17.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_17.Text + Call-btnTab5_17 + }) + } + + If ($buttonID -eq "18"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_18.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_18.IsEnabled = $false} Else {$WPFbtnTab5_18.IsEnabled = $true} + $WPFbtnTextTab5_18.Text = $button.Name + $WPFbtnTab5_18.Background = $button.bgcolor + $WPFbtnTab5_18.Foreground = $button.textcolor + $WPFbtnTab5_18.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_18.Text + Call-btnTab5_18 + }) + } + + If ($buttonID -eq "19"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_19.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_19.IsEnabled = $false} Else {$WPFbtnTab5_19.IsEnabled = $true} + $WPFbtnTextTab5_19.Text = $button.Name + $WPFbtnTab5_19.Background = $button.bgcolor + $WPFbtnTab5_19.Foreground = $button.textcolor + $WPFbtnTab5_19.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_19.Text + Call-btnTab5_19 + }) + } + + If ($buttonID -eq "20"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_20.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_20.IsEnabled = $false} Else {$WPFbtnTab5_20.IsEnabled = $true} + $WPFbtnTextTab5_20.Text = $button.Name + $WPFbtnTab5_20.Background = $button.bgcolor + $WPFbtnTab5_20.Foreground = $button.textcolor + $WPFbtnTab5_20.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_20.Text + Call-btnTab5_20 + }) + } + + If ($buttonID -eq "21"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_21.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_21.IsEnabled = $false} Else {$WPFbtnTab5_21.IsEnabled = $true} + $WPFbtnTextTab5_21.Text = $button.Name + $WPFbtnTab5_21.Background = $button.bgcolor + $WPFbtnTab5_21.Foreground = $button.textcolor + $WPFbtnTab5_21.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_21.Text + Call-btnTab5_21 + }) + } + + If ($buttonID -eq "22"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_22.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_22.IsEnabled = $false} Else {$WPFbtnTab5_22.IsEnabled = $true} + $WPFbtnTextTab5_22.Text = $button.Name + $WPFbtnTab5_22.Background = $button.bgcolor + $WPFbtnTab5_22.Foreground = $button.textcolor + $WPFbtnTab5_22.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_22.Text + Call-btnTab5_22 + }) + } + + If ($buttonID -eq "23"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_23.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_23.IsEnabled = $false} Else {$WPFbtnTab5_23.IsEnabled = $true} + $WPFbtnTextTab5_23.Text = $button.Name + $WPFbtnTab5_23.Background = $button.bgcolor + $WPFbtnTab5_23.Foreground = $button.textcolor + $WPFbtnTab5_23.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_23.Text + Call-btnTab5_23 + }) + } + + If ($buttonID -eq "24"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_24.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_24.IsEnabled = $false} Else {$WPFbtnTab5_24.IsEnabled = $true} + $WPFbtnTextTab5_24.Text = $button.Name + $WPFbtnTab5_24.Background = $button.bgcolor + $WPFbtnTab5_24.Foreground = $button.textcolor + $WPFbtnTab5_24.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_24.Text + Call-btnTab5_24 + }) + } + + If ($buttonID -eq "25"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_25.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_25.IsEnabled = $false} Else {$WPFbtnTab5_25.IsEnabled = $true} + $WPFbtnTextTab5_25.Text = $button.Name + $WPFbtnTab5_25.Background = $button.bgcolor + $WPFbtnTab5_25.Foreground = $button.textcolor + $WPFbtnTab5_25.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_25.Text + Call-btnTab5_25 + }) + } + + If ($buttonID -eq "26"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab5_26.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab5_26.IsEnabled = $false} Else {$WPFbtnTab5_26.IsEnabled = $true} + $WPFbtnTextTab5_26.Text = $button.Name + $WPFbtnTab5_26.Background = $button.bgcolor + $WPFbtnTab5_26.Foreground = $button.textcolor + $WPFbtnTab5_26.Add_Click({ + $ButtonClicked = $WPFbtnTextTab5_26.Text + Call-btnTab5_26 + }) + } + +} If ($ConfigTab5.enable -eq "false"){$WPFTab5.Visibility = 'Hidden'} Else {$WPFTab5.Visibility = 'Visible'} \ No newline at end of file diff --git a/App/Extensions/TabControl/AdminMenu-Tab6.ps1 b/Extensions/TabControl/AdminMenu-Tab6.ps1 similarity index 95% rename from App/Extensions/TabControl/AdminMenu-Tab6.ps1 rename to Extensions/TabControl/AdminMenu-Tab6.ps1 index 6b16b94..25fd44f 100644 --- a/App/Extensions/TabControl/AdminMenu-Tab6.ps1 +++ b/Extensions/TabControl/AdminMenu-Tab6.ps1 @@ -1,500 +1,500 @@ -##*============================================= -##* LOAD TAB 2 FROM CONFIG -##*============================================= -$ConfigTab6 = $AppMenuTabandButtons.tab[5] - -##*============================================= -##* FORM ADD CLICK FUNCTIONS -##*============================================= -<# - Examples to use (place in function): - - SIMPLE: - Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal - - SEND TO OUTPUT (PASSTHRU): - Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 - $PasstoOutput = Start-Process -FilePath "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String - If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} - - OPEN EXTERNAL PS1 - . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") - - USE INTGRATED FUNCTION (EASIEST) - - to log to output box in tab, use -OutputTab switch - - to identify process alias, use -Alias switch, otherwise path will be used instead - - to specify a custom run message use the -CustomRunMsg switch - - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) - - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch - - EXAMPLE (EXE): - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (EXE) with Parameters: - Start-ButtonProcess -Alias "$ButtonClicked" -Path "$env:windir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal - - EXAMPLE (PS1): - Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow - -#> -function Call-btnTab6_01{ - Start-ButtonProcess -ProcessCall invoke -File "ClipboardHistoryViewer.ps1" -OutputTab tab1 -CreateNoWindow -} - -function Call-btnTab6_02{ -} - -function Call-btnTab6_03{ - Start-ButtonProcess -ProcessCall ps1 -File "PowerCopy.ps1" -OutputTab tab1 -CreateNoWindow -} - -function Call-btnTab6_04{ - -} - -function Call-btnTab6_05{ - -} - -function Call-btnTab6_06{ - Start-ButtonProcess -ProcessCall invoke -File "GetDiskSpaceMultipleComputers.ps1" -OutputTab tab1 -CreateNoWindow -} - -function Call-btnTab6_07{ - Start-ButtonProcess -ProcessCall ps1 -File "Convert-Image.ps1" -OutputTab tab1 -CreateNoWindow -} - -function Call-btnTab6_08{ - Start-ButtonProcess -ProcessCall ps1 -File "Generate-Password.ps1" -OutputTab tab1 -CreateNoWindow -} - - -function Call-btnTab6_09{ - Start-ButtonProcess -ProcessCall ps1 -File "NetworkPing.ps1" -OutputTab tab1 -CreateNoWindow -} - - -function Call-btnTab6_10{ - Start-ButtonProcess -Path "$UtilPath\NetCalc.exe" -OutputTab tab1 -WindowStyle Normal -} - -function Call-btnTab6_11{ - -} - -function Call-btnTab6_12{ - -} - -function Call-btnTab6_13{ - -} - -function Call-btnTab6_14{ - -} - -function Call-btnTab6_15{ - -} - -function Call-btnTab6_16{ - -} - -function Call-btnTab6_17{ - Start-ButtonProcess -ProcessCall ps1 -File "LazyWinAdmin-v0.4.ps1" -WorkingScriptDirectory "LazyWinAdmin-v0.4" -OutputTab tab1 -CreateNoWindow -} - -function Call-btnTab6_18{ - -} - -function Call-btnTab6_19{ - -} - -function Call-btnTab6_20{ - -} - -function Call-btnTab6_21{ - -} - -function Call-btnTab6_22{ - -} - -function Call-btnTab6_23{ - -} - -function Call-btnTab6_24{ - Start-ButtonProcess -ProcessCall ps1 -File "Show-PSHelpTree.ps1" -OutputTab tab1 -CreateNoWindow -} - - -##*============================================= -##* TAB 1 OTHER FUNCTIONS -##*============================================= - - - - -##*============================================= -##* BUILD TAB 1 BUTTONS IF CONFIGURED -##*============================================= -$ConfigTab6_Name = $ConfigTab6.Name - -$WPFTab6.Header = $ConfigTab6_Name -$WPFlblTab6Section1.Content = $ConfigTab6.section1Label - -$ConfigTab6_btns = $ConfigTab6.button - - -Foreach ($button in $ConfigTab6_btns){ - - [string]$buttonID = $button.id - If ($AppOptionDebugeMode){Write-Host "Tab6: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} - - If ($buttonID -eq "01"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_01.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_01.IsEnabled = $false} Else {$WPFbtnTab6_01.IsEnabled = $true} - $WPFbtnTextTab6_01.Text = $button.Name - $WPFbtnTab6_01.Background = $button.bgcolor - $WPFbtnTab6_01.Foreground = $button.textcolor - #$WPFbtnTab6_01.Add_Click({Call-btnTab6_01}) - $WPFbtnTab6_01.add_Click({ - $ButtonClicked = $WPFbtnTextTab6_01.Text - Call-btnTab6_01 - }) - } - - If ($buttonID -eq "02"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_02.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_02.IsEnabled = $false} Else {$WPFbtnTab6_02.IsEnabled = $true} - $WPFbtnTextTab6_02.Text = $button.Name - $WPFbtnTab6_02.Background = $button.bgcolor - $WPFbtnTab6_02.Foreground = $button.textcolor - $WPFbtnTab6_02.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_02.Text - Call-btnTab6_02 - }) - } - - If ($buttonID -eq "03"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_03.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_03.IsEnabled = $false} Else {$WPFbtnTab6_03.IsEnabled = $true} - $WPFbtnTextTab6_03.Text = $button.Name - $WPFbtnTab6_03.Background = $button.bgcolor - $WPFbtnTab6_03.Foreground = $button.textcolor - $WPFbtnTab6_03.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_03.Text - Call-btnTab6_03 - }) - } - - If ($buttonID -eq "04"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_04.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_04.IsEnabled = $false} Else {$WPFbtnTab6_04.IsEnabled = $true} - $WPFbtnTextTab6_04.Text = $button.Name - $WPFbtnTab6_04.Background = $button.bgcolor - $WPFbtnTab6_04.Foreground = $button.textcolor - $WPFbtnTab6_04.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_04.Text - Call-btnTab6_04 - }) - } - - If ($buttonID -eq "05"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_05.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_05.IsEnabled = $false} Else {$WPFbtnTab6_05.IsEnabled = $true} - $WPFbtnTextTab6_05.Text = $button.Name - $WPFbtnTab6_05.Background = $button.bgcolor - $WPFbtnTab6_05.Foreground = $button.textcolor - $WPFbtnTab6_05.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_05.Text - Call-btnTab6_05 - }) - } - - If ($buttonID -eq "06"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_06.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_06.IsEnabled = $false} Else {$WPFbtnTab6_06.IsEnabled = $true} - $WPFbtnTextTab6_06.Text = $button.Name - $WPFbtnTab6_06.Background = $button.bgcolor - $WPFbtnTab6_06.Foreground = $button.textcolor - $WPFbtnTab6_06.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_06.Text - Call-btnTab6_06 - }) - } - - If ($buttonID -eq "07"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_07.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_07.IsEnabled = $false} Else {$WPFbtnTab6_07.IsEnabled = $true} - $WPFbtnTextTab6_07.Text = $button.Name - $WPFbtnTab6_07.Background = $button.bgcolor - $WPFbtnTab6_07.Foreground = $button.textcolor - $WPFbtnTab6_07.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_07.Text - Call-btnTab6_07 - }) - } - - If ($buttonID -eq "08"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_08.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_08.IsEnabled = $false} Else {$WPFbtnTab6_08.IsEnabled = $true} - $WPFbtnTextTab6_08.Text = $button.Name - $WPFbtnTab6_08.Background = $button.bgcolor - $WPFbtnTab6_08.Foreground = $button.textcolor - $WPFbtnTab6_08.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_08.Text - Call-btnTab6_08 - }) - } - - If ($buttonID -eq "09"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_09.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_09.IsEnabled = $false} Else {$WPFbtnTab6_09.IsEnabled = $true} - $WPFbtnTextTab6_09.Text = $button.Name - $WPFbtnTab6_09.Background = $button.bgcolor - $WPFbtnTab6_09.Foreground = $button.textcolor - $WPFbtnTab6_09.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_09.Text - Call-btnTab6_09 - }) - } - - If ($buttonID -eq "10"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_10.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_10.IsEnabled = $false} Else {$WPFbtnTab6_10.IsEnabled = $true} - $WPFbtnTextTab6_10.Text = $button.Name - $WPFbtnTab6_10.Background = $button.bgcolor - $WPFbtnTab6_10.Foreground = $button.textcolor - $WPFbtnTab6_10.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_10.Text - Call-btnTab6_10 - }) - } - - If ($buttonID -eq "11"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_11.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_11.IsEnabled = $false} Else {$WPFbtnTab6_11.IsEnabled = $true} - $WPFbtnTextTab6_11.Text = $button.Name - $WPFbtnTab6_11.Background = $button.bgcolor - $WPFbtnTab6_11.Foreground = $button.textcolor - $WPFbtnTab6_11.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_11.Text - Call-btnTab6_11 - }) - } - - If ($buttonID -eq "12"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_12.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_12.IsEnabled = $false} Else {$WPFbtnTab6_12.IsEnabled = $true} - $WPFbtnTextTab6_12.Text = $button.Name - $WPFbtnTab6_12.Background = $button.bgcolor - $WPFbtnTab6_12.Foreground = $button.textcolor - $WPFbtnTab6_12.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_12.Text - Call-btnTab6_12 - }) - } - - If ($buttonID -eq "13"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_13.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_13.IsEnabled = $false} Else {$WPFbtnTab6_13.IsEnabled = $true} - $WPFbtnTextTab6_13.Text = $button.Name - $WPFbtnTab6_13.Background = $button.bgcolor - $WPFbtnTab6_13.Foreground = $button.textcolor - $WPFbtnTab6_13.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_13.Text - Call-btnTab6_13 - }) - } - If ($buttonID -eq "14"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_14.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_14.IsEnabled = $false} Else {$WPFbtnTab6_14.IsEnabled = $true} - $WPFbtnTextTab6_14.Text = $button.Name - $WPFbtnTab6_14.Background = $button.bgcolor - $WPFbtnTab6_14.Foreground = $button.textcolor - $WPFbtnTab6_14.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_14.Text - Call-btnTab6_14 - }) - } - - If ($buttonID -eq "15"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_15.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_15.IsEnabled = $false} Else {$WPFbtnTab6_15.IsEnabled = $true} - $WPFbtnTextTab6_15.Text = $button.Name - $WPFbtnTab6_15.Background = $button.bgcolor - $WPFbtnTab6_15.Foreground = $button.textcolor - $WPFbtnTab6_15.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_15.Text - Call-btnTab6_15 - }) - } - - If ($buttonID -eq "16"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_16.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_16.IsEnabled = $false} Else {$WPFbtnTab6_16.IsEnabled = $true} - $WPFbtnTextTab6_16.Text = $button.Name - $WPFbtnTab6_16.Background = $button.bgcolor - $WPFbtnTab6_16.Foreground = $button.textcolor - $WPFbtnTab6_16.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_16.Text - Call-btnTab6_16 - }) - } - - If ($buttonID -eq "17"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_17.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_17.IsEnabled = $false} Else {$WPFbtnTab6_17.IsEnabled = $true} - $WPFbtnTextTab6_17.Text = $button.Name - $WPFbtnTab6_17.Background = $button.bgcolor - $WPFbtnTab6_17.Foreground = $button.textcolor - $WPFbtnTab6_17.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_17.Text - Call-btnTab6_17 - }) - } - - If ($buttonID -eq "18"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_18.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_18.IsEnabled = $false} Else {$WPFbtnTab6_18.IsEnabled = $true} - $WPFbtnTextTab6_18.Text = $button.Name - $WPFbtnTab6_18.Background = $button.bgcolor - $WPFbtnTab6_18.Foreground = $button.textcolor - $WPFbtnTab6_18.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_18.Text - Call-btnTab6_18 - }) - } - - If ($buttonID -eq "19"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_19.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_19.IsEnabled = $false} Else {$WPFbtnTab6_19.IsEnabled = $true} - $WPFbtnTextTab6_19.Text = $button.Name - $WPFbtnTab6_19.Background = $button.bgcolor - $WPFbtnTab6_19.Foreground = $button.textcolor - $WPFbtnTab6_19.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_19.Text - Call-btnTab6_19 - }) - } - - If ($buttonID -eq "20"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_20.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_20.IsEnabled = $false} Else {$WPFbtnTab6_20.IsEnabled = $true} - $WPFbtnTextTab6_20.Text = $button.Name - $WPFbtnTab6_20.Background = $button.bgcolor - $WPFbtnTab6_20.Foreground = $button.textcolor - $WPFbtnTab6_20.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_20.Text - Call-btnTab6_20 - }) - } - - If ($buttonID -eq "21"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_21.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_21.IsEnabled = $false} Else {$WPFbtnTab6_21.IsEnabled = $true} - $WPFbtnTextTab6_21.Text = $button.Name - $WPFbtnTab6_21.Background = $button.bgcolor - $WPFbtnTab6_21.Foreground = $button.textcolor - $WPFbtnTab6_21.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_21.Text - Call-btnTab6_21 - }) - } - - If ($buttonID -eq "22"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_22.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_22.IsEnabled = $false} Else {$WPFbtnTab6_22.IsEnabled = $true} - $WPFbtnTextTab6_22.Text = $button.Name - $WPFbtnTab6_22.Background = $button.bgcolor - $WPFbtnTab6_22.Foreground = $button.textcolor - $WPFbtnTab6_22.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_22.Text - Call-btnTab6_22 - }) - } - - If ($buttonID -eq "23"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_23.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_23.IsEnabled = $false} Else {$WPFbtnTab6_23.IsEnabled = $true} - $WPFbtnTextTab6_23.Text = $button.Name - $WPFbtnTab6_23.Background = $button.bgcolor - $WPFbtnTab6_23.Foreground = $button.textcolor - $WPFbtnTab6_23.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_23.Text - Call-btnTab6_23 - }) - } - - If ($buttonID -eq "24"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_24.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_24.IsEnabled = $false} Else {$WPFbtnTab6_24.IsEnabled = $true} - $WPFbtnTextTab6_24.Text = $button.Name - $WPFbtnTab6_24.Background = $button.bgcolor - $WPFbtnTab6_24.Foreground = $button.textcolor - $WPFbtnTab6_24.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_24.Text - Call-btnTab6_24 - }) - } - - If ($buttonID -eq "25"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_25.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_25.IsEnabled = $false} Else {$WPFbtnTab6_25.IsEnabled = $true} - $WPFbtnTextTab6_25.Text = $button.Name - $WPFbtnTab6_25.Background = $button.bgcolor - $WPFbtnTab6_25.Foreground = $button.textcolor - $WPFbtnTab6_25.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_25.Text - Call-btnTab6_25 - }) - } - - If ($buttonID -eq "26"){ - If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} - $WPFbtnTab6_26.Visibility = 'Visible' - If ($button.enable -eq "false"){$WPFbtnTab6_26.IsEnabled = $false} Else {$WPFbtnTab6_26.IsEnabled = $true} - $WPFbtnTextTab6_26.Text = $button.Name - $WPFbtnTab6_26.Background = $button.bgcolor - $WPFbtnTab6_26.Foreground = $button.textcolor - $WPFbtnTab6_26.Add_Click({ - $ButtonClicked = $WPFbtnTextTab6_26.Text - Call-btnTab6_26 - }) - } - -} +##*============================================= +##* LOAD TAB 2 FROM CONFIG +##*============================================= +$ConfigTab6 = $AppMenuTabandButtons.tab[5] + +##*============================================= +##* FORM ADD CLICK FUNCTIONS +##*============================================= +<# + Examples to use (place in function): + + SIMPLE: + Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal + + SEND TO OUTPUT (PASSTHRU): + Write-OutputBox -OutputBoxMessage "Opening Powershell window." -Type "START: " -Object Tab1 + $PasstoOutput = Start-Process -File "$PSHOME\PowerShell.exe" -WindowStyle Normal -PassThru | Out-String + If ($AppOptionDebugeMode){Write-OutputBox -OutputBoxMessage $PasstoOutput -Type "INFO: " -Object Tab1} + + OPEN EXTERNAL PS1 + . ($scriptRoot + "\Scripts\ClipboardHistoryViewer.ps1") + + USE INTGRATED FUNCTION (EASIEST) + - to log to output box in tab, use -OutputTab switch + - to identify process alias, use -Alias switch, otherwise path will be used instead + - to specify a custom run message use the -CustomRunMsg switch + - to specify a custom error message use the -CustomErrMsg switch (this will only display if errors) + - Auto use credentials feature if selected in menu, you can force it not to by adding -NeverRunAs switch + + EXAMPLE (EXE): + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$PSHOME\PowerShell.exe" -WorkingDirectory "$envWinDir\System32" -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (EXE) with Parameters: + Start-ButtonProcess -Alias "$ButtonClicked" -Path "$env:windir\system32\mstsc.exe" -Parameters ("/v:" + $WPFtxtBoxRemote.Text) -OutputTab tab1 -WindowStyle Normal + + EXAMPLE (PS1): + Start-ButtonProcess -ProcessCall ps1 -File "Start-PoshPAIG.ps1" -WorkingDirectory "$($scriptRoot + "\Scripts\PoshPAIG_2_1_5")" -CreateNoWindow + +#> +function Call-btnTab6_01{ + Start-ButtonProcess -ProcessCall ps1 -File "ClipboardHistoryViewer.ps1" -OutputTab tab1 +} + +function Call-btnTab6_02{ +} + +function Call-btnTab6_03{ + Start-ButtonProcess -ProcessCall ps1 -File "PowerCopy.ps1" -OutputTab tab1 -CreateNoWindow +} + +function Call-btnTab6_04{ + +} + +function Call-btnTab6_05{ + +} + +function Call-btnTab6_06{ + Start-ButtonProcess -ProcessCall invoke -File "GetDiskSpaceMultipleComputers.ps1" -OutputTab tab1 -CreateNoWindow +} + +function Call-btnTab6_07{ + Start-ButtonProcess -ProcessCall ps1 -File "Convert-Image.ps1" -OutputTab tab1 -CreateNoWindow +} + +function Call-btnTab6_08{ + Start-ButtonProcess -ProcessCall ps1 -File "Generate-Password.ps1" -OutputTab tab1 -CreateNoWindow +} + + +function Call-btnTab6_09{ + Start-ButtonProcess -ProcessCall ps1 -File "NetworkPing.ps1" -OutputTab tab1 -CreateNoWindow +} + + +function Call-btnTab6_10{ + Start-ButtonProcess -Path "$UtilPath\NetCalc.exe" -OutputTab tab1 -WindowStyle Normal +} + +function Call-btnTab6_11{ + +} + +function Call-btnTab6_12{ + +} + +function Call-btnTab6_13{ + +} + +function Call-btnTab6_14{ + +} + +function Call-btnTab6_15{ + +} + +function Call-btnTab6_16{ + +} + +function Call-btnTab6_17{ + +} + +function Call-btnTab6_18{ + +} + +function Call-btnTab6_19{ + +} + +function Call-btnTab6_20{ + +} + +function Call-btnTab6_21{ + +} + +function Call-btnTab6_22{ + +} + +function Call-btnTab6_23{ + +} + +function Call-btnTab6_24{ + Start-ButtonProcess -ProcessCall ps1 -File "Show-PSHelpTree.ps1" -OutputTab tab1 -CreateNoWindow +} + + +##*============================================= +##* TAB 1 OTHER FUNCTIONS +##*============================================= + + + + +##*============================================= +##* BUILD TAB 1 BUTTONS IF CONFIGURED +##*============================================= +$ConfigTab6_Name = $ConfigTab6.Name + +$WPFTab6.Header = $ConfigTab6_Name +$WPFlblTab6Section1.Content = $ConfigTab6.section1Label + +$ConfigTab6_btns = $ConfigTab6.button + + +Foreach ($button in $ConfigTab6_btns){ + + [string]$buttonID = $button.id + If ($AppOptionDebugeMode){Write-Host "Tab6: Parsing 'button $buttonID' configurations" -ForegroundColor Gray} + + If ($buttonID -eq "01"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_01.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_01.IsEnabled = $false} Else {$WPFbtnTab6_01.IsEnabled = $true} + $WPFbtnTextTab6_01.Text = $button.Name + $WPFbtnTab6_01.Background = $button.bgcolor + $WPFbtnTab6_01.Foreground = $button.textcolor + #$WPFbtnTab6_01.Add_Click({Call-btnTab6_01}) + $WPFbtnTab6_01.add_Click({ + $ButtonClicked = $WPFbtnTextTab6_01.Text + Call-btnTab6_01 + }) + } + + If ($buttonID -eq "02"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_02.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_02.IsEnabled = $false} Else {$WPFbtnTab6_02.IsEnabled = $true} + $WPFbtnTextTab6_02.Text = $button.Name + $WPFbtnTab6_02.Background = $button.bgcolor + $WPFbtnTab6_02.Foreground = $button.textcolor + $WPFbtnTab6_02.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_02.Text + Call-btnTab6_02 + }) + } + + If ($buttonID -eq "03"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_03.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_03.IsEnabled = $false} Else {$WPFbtnTab6_03.IsEnabled = $true} + $WPFbtnTextTab6_03.Text = $button.Name + $WPFbtnTab6_03.Background = $button.bgcolor + $WPFbtnTab6_03.Foreground = $button.textcolor + $WPFbtnTab6_03.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_03.Text + Call-btnTab6_03 + }) + } + + If ($buttonID -eq "04"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_04.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_04.IsEnabled = $false} Else {$WPFbtnTab6_04.IsEnabled = $true} + $WPFbtnTextTab6_04.Text = $button.Name + $WPFbtnTab6_04.Background = $button.bgcolor + $WPFbtnTab6_04.Foreground = $button.textcolor + $WPFbtnTab6_04.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_04.Text + Call-btnTab6_04 + }) + } + + If ($buttonID -eq "05"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_05.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_05.IsEnabled = $false} Else {$WPFbtnTab6_05.IsEnabled = $true} + $WPFbtnTextTab6_05.Text = $button.Name + $WPFbtnTab6_05.Background = $button.bgcolor + $WPFbtnTab6_05.Foreground = $button.textcolor + $WPFbtnTab6_05.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_05.Text + Call-btnTab6_05 + }) + } + + If ($buttonID -eq "06"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_06.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_06.IsEnabled = $false} Else {$WPFbtnTab6_06.IsEnabled = $true} + $WPFbtnTextTab6_06.Text = $button.Name + $WPFbtnTab6_06.Background = $button.bgcolor + $WPFbtnTab6_06.Foreground = $button.textcolor + $WPFbtnTab6_06.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_06.Text + Call-btnTab6_06 + }) + } + + If ($buttonID -eq "07"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_07.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_07.IsEnabled = $false} Else {$WPFbtnTab6_07.IsEnabled = $true} + $WPFbtnTextTab6_07.Text = $button.Name + $WPFbtnTab6_07.Background = $button.bgcolor + $WPFbtnTab6_07.Foreground = $button.textcolor + $WPFbtnTab6_07.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_07.Text + Call-btnTab6_07 + }) + } + + If ($buttonID -eq "08"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_08.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_08.IsEnabled = $false} Else {$WPFbtnTab6_08.IsEnabled = $true} + $WPFbtnTextTab6_08.Text = $button.Name + $WPFbtnTab6_08.Background = $button.bgcolor + $WPFbtnTab6_08.Foreground = $button.textcolor + $WPFbtnTab6_08.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_08.Text + Call-btnTab6_08 + }) + } + + If ($buttonID -eq "09"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_09.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_09.IsEnabled = $false} Else {$WPFbtnTab6_09.IsEnabled = $true} + $WPFbtnTextTab6_09.Text = $button.Name + $WPFbtnTab6_09.Background = $button.bgcolor + $WPFbtnTab6_09.Foreground = $button.textcolor + $WPFbtnTab6_09.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_09.Text + Call-btnTab6_09 + }) + } + + If ($buttonID -eq "10"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_10.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_10.IsEnabled = $false} Else {$WPFbtnTab6_10.IsEnabled = $true} + $WPFbtnTextTab6_10.Text = $button.Name + $WPFbtnTab6_10.Background = $button.bgcolor + $WPFbtnTab6_10.Foreground = $button.textcolor + $WPFbtnTab6_10.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_10.Text + Call-btnTab6_10 + }) + } + + If ($buttonID -eq "11"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_11.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_11.IsEnabled = $false} Else {$WPFbtnTab6_11.IsEnabled = $true} + $WPFbtnTextTab6_11.Text = $button.Name + $WPFbtnTab6_11.Background = $button.bgcolor + $WPFbtnTab6_11.Foreground = $button.textcolor + $WPFbtnTab6_11.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_11.Text + Call-btnTab6_11 + }) + } + + If ($buttonID -eq "12"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_12.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_12.IsEnabled = $false} Else {$WPFbtnTab6_12.IsEnabled = $true} + $WPFbtnTextTab6_12.Text = $button.Name + $WPFbtnTab6_12.Background = $button.bgcolor + $WPFbtnTab6_12.Foreground = $button.textcolor + $WPFbtnTab6_12.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_12.Text + Call-btnTab6_12 + }) + } + + If ($buttonID -eq "13"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_13.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_13.IsEnabled = $false} Else {$WPFbtnTab6_13.IsEnabled = $true} + $WPFbtnTextTab6_13.Text = $button.Name + $WPFbtnTab6_13.Background = $button.bgcolor + $WPFbtnTab6_13.Foreground = $button.textcolor + $WPFbtnTab6_13.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_13.Text + Call-btnTab6_13 + }) + } + If ($buttonID -eq "14"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_14.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_14.IsEnabled = $false} Else {$WPFbtnTab6_14.IsEnabled = $true} + $WPFbtnTextTab6_14.Text = $button.Name + $WPFbtnTab6_14.Background = $button.bgcolor + $WPFbtnTab6_14.Foreground = $button.textcolor + $WPFbtnTab6_14.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_14.Text + Call-btnTab6_14 + }) + } + + If ($buttonID -eq "15"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_15.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_15.IsEnabled = $false} Else {$WPFbtnTab6_15.IsEnabled = $true} + $WPFbtnTextTab6_15.Text = $button.Name + $WPFbtnTab6_15.Background = $button.bgcolor + $WPFbtnTab6_15.Foreground = $button.textcolor + $WPFbtnTab6_15.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_15.Text + Call-btnTab6_15 + }) + } + + If ($buttonID -eq "16"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_16.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_16.IsEnabled = $false} Else {$WPFbtnTab6_16.IsEnabled = $true} + $WPFbtnTextTab6_16.Text = $button.Name + $WPFbtnTab6_16.Background = $button.bgcolor + $WPFbtnTab6_16.Foreground = $button.textcolor + $WPFbtnTab6_16.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_16.Text + Call-btnTab6_16 + }) + } + + If ($buttonID -eq "17"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_17.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_17.IsEnabled = $false} Else {$WPFbtnTab6_17.IsEnabled = $true} + $WPFbtnTextTab6_17.Text = $button.Name + $WPFbtnTab6_17.Background = $button.bgcolor + $WPFbtnTab6_17.Foreground = $button.textcolor + $WPFbtnTab6_17.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_17.Text + Call-btnTab6_17 + }) + } + + If ($buttonID -eq "18"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_18.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_18.IsEnabled = $false} Else {$WPFbtnTab6_18.IsEnabled = $true} + $WPFbtnTextTab6_18.Text = $button.Name + $WPFbtnTab6_18.Background = $button.bgcolor + $WPFbtnTab6_18.Foreground = $button.textcolor + $WPFbtnTab6_18.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_18.Text + Call-btnTab6_18 + }) + } + + If ($buttonID -eq "19"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_19.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_19.IsEnabled = $false} Else {$WPFbtnTab6_19.IsEnabled = $true} + $WPFbtnTextTab6_19.Text = $button.Name + $WPFbtnTab6_19.Background = $button.bgcolor + $WPFbtnTab6_19.Foreground = $button.textcolor + $WPFbtnTab6_19.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_19.Text + Call-btnTab6_19 + }) + } + + If ($buttonID -eq "20"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_20.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_20.IsEnabled = $false} Else {$WPFbtnTab6_20.IsEnabled = $true} + $WPFbtnTextTab6_20.Text = $button.Name + $WPFbtnTab6_20.Background = $button.bgcolor + $WPFbtnTab6_20.Foreground = $button.textcolor + $WPFbtnTab6_20.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_20.Text + Call-btnTab6_20 + }) + } + + If ($buttonID -eq "21"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_21.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_21.IsEnabled = $false} Else {$WPFbtnTab6_21.IsEnabled = $true} + $WPFbtnTextTab6_21.Text = $button.Name + $WPFbtnTab6_21.Background = $button.bgcolor + $WPFbtnTab6_21.Foreground = $button.textcolor + $WPFbtnTab6_21.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_21.Text + Call-btnTab6_21 + }) + } + + If ($buttonID -eq "22"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_22.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_22.IsEnabled = $false} Else {$WPFbtnTab6_22.IsEnabled = $true} + $WPFbtnTextTab6_22.Text = $button.Name + $WPFbtnTab6_22.Background = $button.bgcolor + $WPFbtnTab6_22.Foreground = $button.textcolor + $WPFbtnTab6_22.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_22.Text + Call-btnTab6_22 + }) + } + + If ($buttonID -eq "23"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_23.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_23.IsEnabled = $false} Else {$WPFbtnTab6_23.IsEnabled = $true} + $WPFbtnTextTab6_23.Text = $button.Name + $WPFbtnTab6_23.Background = $button.bgcolor + $WPFbtnTab6_23.Foreground = $button.textcolor + $WPFbtnTab6_23.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_23.Text + Call-btnTab6_23 + }) + } + + If ($buttonID -eq "24"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_24.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_24.IsEnabled = $false} Else {$WPFbtnTab6_24.IsEnabled = $true} + $WPFbtnTextTab6_24.Text = $button.Name + $WPFbtnTab6_24.Background = $button.bgcolor + $WPFbtnTab6_24.Foreground = $button.textcolor + $WPFbtnTab6_24.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_24.Text + Call-btnTab6_24 + }) + } + + If ($buttonID -eq "25"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_25.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_25.IsEnabled = $false} Else {$WPFbtnTab6_25.IsEnabled = $true} + $WPFbtnTextTab6_25.Text = $button.Name + $WPFbtnTab6_25.Background = $button.bgcolor + $WPFbtnTab6_25.Foreground = $button.textcolor + $WPFbtnTab6_25.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_25.Text + Call-btnTab6_25 + }) + } + + If ($buttonID -eq "26"){ + If ($AppOptionDebugeMode){write-Host " Loading 'button $buttonID' --> $($button.Name)"} + $WPFbtnTab6_26.Visibility = 'Visible' + If ($button.enable -eq "false"){$WPFbtnTab6_26.IsEnabled = $false} Else {$WPFbtnTab6_26.IsEnabled = $true} + $WPFbtnTextTab6_26.Text = $button.Name + $WPFbtnTab6_26.Background = $button.bgcolor + $WPFbtnTab6_26.Foreground = $button.textcolor + $WPFbtnTab6_26.Add_Click({ + $ButtonClicked = $WPFbtnTextTab6_26.Text + Call-btnTab6_26 + }) + } + +} If ($ConfigTab6.enable -eq "false"){$WPFTab6.Visibility = 'Hidden'} Else {$WPFTab6.Visibility = 'Visible'} \ No newline at end of file diff --git a/App/Extensions/TabControl/AdminMenu-Tabs.prereq b/Extensions/TabControl/AdminMenu-Tabs.prereq similarity index 98% rename from App/Extensions/TabControl/AdminMenu-Tabs.prereq rename to Extensions/TabControl/AdminMenu-Tabs.prereq index f3de5a6..6c39485 100644 --- a/App/Extensions/TabControl/AdminMenu-Tabs.prereq +++ b/Extensions/TabControl/AdminMenu-Tabs.prereq @@ -1,17 +1,17 @@ -[InstalledPath] -MSInfo=$env:programfiles\Common Files\Microsoft Shared\MSInfo\msinfo32.exe -Dameware=$envProgramFilesX86\DameWare Development\DameWare NT Utilities -CMToolkit=$envProgramFilesX86\ConfigMgr 2012 Toolkit R2\ClientTools -SCCMPath=$($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) -DartTools=$envProgramFiles\Microsoft DaRT\v10 -ADKTools=$envProgramFilesX86\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools -MDTWorkBench=$envProgramFiles\Microsoft Deployment Toolkit\Bin\DeploymentWorkbench.msc -SCOM=$envProgramFiles\Microsoft System Center 2012 R2\Operations Manager\Console -SCSM=$envProgramFiles\Microsoft System Center 2012 R2\Service Manager -SCORCH=$envProgramFilesX86\Microsoft System Center 2012 R2\Orchestrator\Runbook Designer -SCVMM=$envProgramFiles\Microsoft System Center 2012 Virtual Machine Manager\bin -EXCH=$envProgramFiles\Microsoft\Exchange Server\V14\bin -VMwareSphere=$envProgramFilesX86\VMware\Infrastructure\Virtual Infrastructure Client\Launcher -Netapp=$envProgramFiles\NetApp\OnCommand System Manager -VMwareView=$envProgramFilesX86\VMware\VMware Horizon View Client +[InstalledPath] +MSInfo=$env:programfiles\Common Files\Microsoft Shared\MSInfo\msinfo32.exe +Dameware=$envProgramFilesX86\DameWare Development\DameWare NT Utilities +CMToolkit=$envProgramFilesX86\ConfigMgr 2012 Toolkit R2\ClientTools +SCCMPath=$($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) +DartTools=$envProgramFiles\Microsoft DaRT\v10 +ADKTools=$envProgramFilesX86\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools +MDTWorkBench=$envProgramFiles\Microsoft Deployment Toolkit\Bin\DeploymentWorkbench.msc +SCOM=$envProgramFiles\Microsoft System Center 2012 R2\Operations Manager\Console +SCSM=$envProgramFiles\Microsoft System Center 2012 R2\Service Manager +SCORCH=$envProgramFilesX86\Microsoft System Center 2012 R2\Orchestrator\Runbook Designer +SCVMM=$envProgramFiles\Microsoft System Center 2012 Virtual Machine Manager\bin +EXCH=$envProgramFiles\Microsoft\Exchange Server\V14\bin +VMwareSphere=$envProgramFilesX86\VMware\Infrastructure\Virtual Infrastructure Client\Launcher +Netapp=$envProgramFiles\NetApp\OnCommand System Manager +VMwareView=$envProgramFilesX86\VMware\VMware Horizon View Client Putty=$envWinDir\system32\putty.exe \ No newline at end of file diff --git a/App/Scripts/BypassCAC.vbs b/Extensions/Tools/BypassCAC.vbs similarity index 100% rename from App/Scripts/BypassCAC.vbs rename to Extensions/Tools/BypassCAC.vbs diff --git a/App/Scripts/ClipboardHistoryViewer.ps1 b/Extensions/Tools/ClipboardHistoryViewer.ps1 similarity index 100% rename from App/Scripts/ClipboardHistoryViewer.ps1 rename to Extensions/Tools/ClipboardHistoryViewer.ps1 diff --git a/App/Scripts/Connect-Mstsc.ps1 b/Extensions/Tools/Connect-Mstsc.ps1 similarity index 100% rename from App/Scripts/Connect-Mstsc.ps1 rename to Extensions/Tools/Connect-Mstsc.ps1 diff --git a/App/Scripts/Convert-Image.ps1 b/Extensions/Tools/Convert-Image.ps1 similarity index 100% rename from App/Scripts/Convert-Image.ps1 rename to Extensions/Tools/Convert-Image.ps1 diff --git a/App/Scripts/DiskSpaceTool.ps1 b/Extensions/Tools/DiskSpaceTool.ps1 similarity index 100% rename from App/Scripts/DiskSpaceTool.ps1 rename to Extensions/Tools/DiskSpaceTool.ps1 diff --git a/App/Scripts/Generate-Password.ps1 b/Extensions/Tools/Generate-Password.ps1 similarity index 100% rename from App/Scripts/Generate-Password.ps1 rename to Extensions/Tools/Generate-Password.ps1 diff --git a/App/Scripts/Get-SystemInfo.ps1 b/Extensions/Tools/Get-SystemInfo.ps1 similarity index 100% rename from App/Scripts/Get-SystemInfo.ps1 rename to Extensions/Tools/Get-SystemInfo.ps1 diff --git a/App/Scripts/GetDiskSpaceMultipleComputers.ps1 b/Extensions/Tools/GetDiskSpaceMultipleComputers.ps1 similarity index 100% rename from App/Scripts/GetDiskSpaceMultipleComputers.ps1 rename to Extensions/Tools/GetDiskSpaceMultipleComputers.ps1 diff --git a/App/Scripts/Invoke-Runspace.ps1 b/Extensions/Tools/Invoke-Runspace.ps1 similarity index 100% rename from App/Scripts/Invoke-Runspace.ps1 rename to Extensions/Tools/Invoke-Runspace.ps1 diff --git a/App/Scripts/NetworkPing.ps1 b/Extensions/Tools/NetworkPing.ps1 similarity index 100% rename from App/Scripts/NetworkPing.ps1 rename to Extensions/Tools/NetworkPing.ps1 diff --git a/Extensions/Tools/PSObjectBrowser.ps1 b/Extensions/Tools/PSObjectBrowser.ps1 new file mode 100644 index 0000000..8a7a9d0 --- /dev/null +++ b/Extensions/Tools/PSObjectBrowser.ps1 @@ -0,0 +1,5842 @@ +#region PS Object Explorer Profile + +Function Get-PSObjectExplorerProfile() +{ +#View Menu + #mnuWMIObjects_Click + #mnuNetAssemblies_Click + #mnuNetClasses_Click + #mnuPSAliases_Click + #mnuPSCommands_Click + #mnuPSDrives_Click + #mnuPSModules_Click + #mnuPSVariables_Click + #mnuWINFeature_Click + #mnuWINProcess_Click + #mnuWINService_Click + #mnuTestCases_Click + +#Options Menu + mnuObjects_Click + mnuStructs_Click + mnuCollections_Click + #mnuNulls_Click + #mnuEmptyStrings_Click + +#Some Objects + + #Add-Node (Get-VMHost) "Virtual Machine Host" + #Add-Node (Get-VM) "Virtual Machines" + #Add-Node (Get-VMSwitch) "Virtual Switches" + + #Add-Node (Get-ADForest) "ADForest" + #Add-Node (Get-ADDomain) "ADDomain" + #Add-Node (Get-ADUser -Filter *) "ADUsers" + #Add-Node (Get-ADComputer -Filter *) "ADComputers" + #Add-Node (Get-ADObject -Filter *) "ADObjects" + + #Add-Node New-Object Microsoft.SqlServer.Management.Smo.Server("(local)") "SQL Server" + +} + +#endregion + +#region Assembly Types +Add-Type -AssemblyName System +Add-Type -AssemblyName System.IO +Add-Type -AssemblyName System.IO.Compression +Add-Type -AssemblyName System.IO.Compression.FileSystem +Add-Type -AssemblyName System.Drawing +Add-Type -AssemblyName System.Windows.Forms +#endregion +#region Script Variables +#region PowerShell Object Browser Variables + +#Hashtable to for POE TreeView Nodes +$Script:POETreeNodes=@{} +# Used to uniquely identify treeview nodes +[Int]$Script:POENextKey=0 + +#endregion +#region Script Variables WMI Win32 Classes + +# Used to order WIN32 classes by name +$Script:WMIClasses = $Null + +# Used to store most recently used +$Script:WMIRootNode=$Null +$Script:WMICategoryNode=$Null +$Script:WMISubCategoryNode=$Null +#endregion +#region Script Variables Net Framework +# Used to store Net Assemblies root node +#$Script:NetAssembliesNode=$Null + +# Used to store Net Assemblies +#$Script:NetAssemblies=$Null + +# Used to store Net Assemblies attributes +#$Script:NetAssembliesToProcess=$Null +#$Script:NetAssemblyMaxClasses=$Null +#$Script:NetAssemblyClasses=$Null + +# Used to store Net Classes root node +#$Script:NetClassesNode=$Null + +# Used to store Net Classes +#$Script:NetClasses = $Null + +# Used to store Net Classes attributes +#$Script:NetClassesProcessed = $Null +#$Script:NetClassIndex=$Null +#endregion +#region Script Variables PS Variables + +# Used to test for PS Automatic Variables +$Script:IsPSAutoVariable = [Ordered]@{ + "$"=$True;"?"=$True;"^"=$True;"_"=$True; + "args"=$True;"ConsoleFileName"=$True;"Error"=$True; + "Event"=$True;"EventArgs"=$True;"EventSubscriber"=$True; + "ExecutionContext"=$True;"False"=$True;"ForEach"=$True; + "Home"=$True;"Host"=$True;"Input"=$True; + "LASTEXITCODE"=$True;"Matches"=$True;"MyInvocation"=$True; + "NestedPromptLevel"=$True;"Null"=$True;"PID"=$True; + "Profile"=$True;"PSBoundParameters"=$True;"PSCmdlet"=$True; + "PSCommandPath"=$True;"PSCulture"=$True;"PSDebugContext"=$True; + "PSHome"=$True;"PSISE"=$True;"PSItem"=$True;"$PSScriptRoot"=$True; + "PSSenderInfo"=$True;"PSScriptRoot"=$True;"PSUICulture"=$True; + "PSUnsupportedConsoleApplications"=$True; + "PSVersionTable"=$True;"PWD"=$True;"ReportErrorShowExceptionClass"=$True; + "ReportErrorShowInnerException"=$True;"ReportErrorShowSource"=$True; + "ReportErrorShowStackTrace"=$True;"Sender"=$True;"ShellID"=$True; + "StackTrace"=$True;"This"=$True;"True"=$True; + } +# Used to test for PS Preference Variables +$Script:IsPSConfigVariable = [Ordered]@{ + "ConfirmPreference"=$True;"DebugPreference"=$True; + "ErrorActionPreference"=$True;"ErrorView"=$True; + "FormatEnumerationLimit"=$True; + "LogCommandHealthEvent"=$True;"LogCommandLifecycleEvent"=$True; + "LogEngineHealthEvent"=$True;"LogEngineLifecycleEvent"=$True; + "LogProviderHealthEvent"=$True;"LogProviderLifecycleEvent"=$True; + "MaximumAliasCount"=$True;"MaximumDriveCount"=$True; + "MaximumErrorCount"=$True;"MaximumFunctionCount"=$True; + "MaximumHistoryCount"=$True;"MaximumVariableCount"=$True; + "OFS"=$True;"OutputEncoding"=$True; + "ProgressPreference"=$True;"PSDefaultParameterValues"=$True; + "PSEmailServer"=$True;"PSModuleAutoLoadingPreference"=$True; + "PSSessionApplicationName"=$True;"PSSessionConfigurationName"=$True; + "PSSessionOption"=$True;"VerbosePreference"=$True; + "WarningPreference"=$True;"WhatIfPreference"=$True; + } + +# Used to test for PS Form Variables +$Script:IsPSFormVariable = @{ + "Form"=$True;"MainMenu"=$True; + "mnuFile"=$True;"mnuExit"=$True; + "mnuView"=$True; + "mnuWMIObjects"=$True;"mnuSeparatorV1"=$True; + "mnuNetAssemblies"=$True;"mnuNetClasses"=$True;"mnuSeparatorV2"=$True; + "mnuPSAliases"=$True;"mnuPSCommands"=$True;"mnuPSDrives"=$True; + "mnuPSModules"=$True;"mnuPSVariables"=$True;"mnuSeparatorV3"=$True; + "mnuWINFeature"=$True;"mnuSeparatorV4"=$True; + "mnuWINProcess"=$True;"mnuWINService"=$True;"mnuSeparatorV5"=$True; + "mnuTestCases"=$True; + "mnuOptions"=$True; + "mnuObjects"=$True;"mnuStructs"=$True;"mnuSeparator4"=$True; + "mnuCollections"=$True;"mnuSeparator5"=$True; + "mnuNulls"=$True;"mnuEmptyStrings"=$True;"mnuSeparator6"=$True; + "mnuHelp"=$True;"mnuAbout"=$True; + "mnuStatus"=$True; + "SplitContainerInstance"=$True;"TabControl"=$True; + "TreeViewInstance"=$True;"StatusBarInstance"=$True; + "TabPageInstance"=$True;"ListViewInstance"=$True; + "TabPageClass"=$True;"ListViewClass"=$True; + "TabPageInterface"=$True;"SplitContainerInterface"=$True; + "TreeViewInterface"=$True;"ListViewInterface"=$True;"StatusBarInterface"=$True; + "TabPagePSObject"=$True;"TextBoxPSObject"=$True; + "TabPageValues"=$True;"TextBoxValues"=$True; + "TabPagePowerShell"=$True;"SplitContainerPowerShell"=$True; + "TextBoxPowerShell"=$True;"ButtonExecute"=$True; + "TextBoxOutput"=$True;"ButtonClear"=$True; + "TabPageWMIClasses"=$True; + "LabelComputers"=$True;"TextBoxComputers"=$True; + "LabelFilter"=$True;"TextBoxFilter"=$True; + "TimerNetClasses"=$True; + } + +# Used to test for PS Script Variables +$Script:IsPSScriptVariable = @{ + "WMIClasses"=$True;"WMIRootNode"=$True; + "WMICategoryNode"=$True;"WMISubCategoryNode"=$True; + "IsPSAutoVariable"=$True;"IsPSConfigVariable"=$True; + "IsPSFormVariable"=$True;"IsPSScriptVariable"=$True; + "IsValidMemberType"=$True;"IsValidPropertyType"=$True; + "IsBooleanValueType"=$True;"IsIntegerValueType"=$True; + "IsFloatingPointType"=$True;"IsCharactersType"=$True; + "IsDateTimeType"=$True; + "IsInstanceValueType"=$True;"IsPropertyValueType"=$True; + "POENextKey"=$True;"POETreeNodes"=$True; + "POEValues"=$True; + } + +#region Script Variables Valid Method and Return Types +#Valid Types +$Script:IsValidMemberType = @{"Property"=$True;"NoteProperty"=$True; + } +$Script:IsValidPropertyType= @{"{get;set;}"=$True;"{get;}"=$True; + } +$Script:IsBooleanValueType= @{ + "bool"=$True;"boolean"=$True;"system.boolean"=$True; + } +$Script:IsIntegerValueType= @{ + "byte"=$True;"system.byte"=$True; + "sbyte"=$True;"system.sbyte"=$True; + "uint16"=$True;"system.uint16"=$True; + "int16"=$True;"system.int16"=$True; + "uint32"=$True;"system.uint32"=$True; + "int32"=$True;"system.int32"=$True; + "int"=$True;"system.int"=$True; + "uint64"=$True;"system.uint64"=$True; + "int64"=$True;"system.int64"=$True; + "long"=$True;"system.long"=$True; + "intptr"=$True;"system.intptr"=$True; + } +$Script:IsFloatingPointType= @{ + "single"=$True;"system.single"=$True; + "double"=$True;"system.double"=$True; + "decimal"=$True;"system.decimal"=$True; + "float"=$True;"system.float"=$True; + } +$Script:IsCharactersType= @{ + "char"=$True;"system.char"=$True; + "string"=$True;"system.string"=$True; + "guid"=$True;"system.guid"=$True; + } +$Script:IsDateTimeType= @{ + "datetime"=$True;"system.datetime"=$True; + "timespan"=$True;"system.timespan"=$True + } +$Script:IsInstanceValueType = $Script:IsBooleanValueType + + $Script:IsIntegerValueType + + $Script:IsFloatingPointType+ + $Script:IsCharactersType +$Script:IsPropertyValueType = $Script:IsBooleanValueType + + $Script:IsIntegerValueType + + $Script:IsFloatingPointType+ + $Script:IsCharactersType + + $Script:IsDateTimeType + +$Script:POEValues ="" +#endregion + +#endregion +#region Helper Functions + +# Increments key to uniquely identify treeview nodes +Function Get-NextKey +{ + [CmdletBinding()] + [OutputType([String])] + param ( + [String]$Name + ) + Try + { + $Script:POENextKey++ + [String]$Script:POENextKey + } + Catch [System.Exception] + { + Write-Verbose "Get-NextKey Catch" + Write-Verbose $_.Exception.Message + } +} + +#Determines if Member Name is Valid +Function Get-IsValidMemberName +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param ( + [Parameter(Mandatory=$true)] + [String]$MemberName, + [Parameter(Mandatory=$true)] + [String]$TypeName + ) + If ($MemberName -EQ "") + { + Return $False + } + ElseIf ($MemberName.Substring(0,1) -EQ "_") + { + Return $False + } + ElseIf ($MemberName.Contains("-")) + { + Return $False + } + ElseIf ($MemberName -EQ "SystemMessages") + { + Return $False + } + ElseIf ($MemberName -EQ "OleDBProviderSettings") + { + Return $False + } + Else + { + Return $True + } +} + +# Return boolean if object is Active Driectory Enitity +Function Get-IsActiveDirectoryEntity +{ + [CmdletBinding()] + [OutputType([Boolean])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + Try + { + Return ($Object -Is [Microsoft.ActiveDirectory.Management.ADEntity]) + } + Catch + { + Return $False + } +} + +# Return boolean if object is collection (has GetNumerator) +Function Get-IsCollection +{ + [CmdletBinding()] + [OutputType([Boolean])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + $IsCollection = $False + If($Object -NE $Null) + { + If (Get-IsActiveDirectoryEntity $Object) + { + } + Else + { + $Members = Get-Member -InputObject $Object + ForEach ($Member In $Members) + { + If ($Member.Name -EQ "GetEnumerator") + { + $IsCollection = $True + break + } + } + } + } + $IsCollection +} +# Return boolean if object is collection (has Keys) +Function Get-IsHashTable +{ + [CmdletBinding()] + [OutputType([Boolean])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + $IsHashTable = $False + If($Object -NE $Null) + { + $Members = Get-Member -InputObject $Object + ForEach ($Member In $Members) + { + If ($Member.Name -EQ "Keys") + { + $IsHashtable = $True + break + } + } + } + $IsHashTable +} + +# Return boolean if object is collection (has GetNumerator) +Function Get-InstanceType +{ + [CmdletBinding()] + [OutputType([String])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + Trap {Continue} + $ObjectType=($Object.GetType()).FullName + Write-Debug "Get-InstanceType ObjectType=$ObjectType" + If ($Object -Is [System.ValueType]) + { + If ($Object -Is [System.Boolean]) + { + Write-Debug "Get-InstanceType Boolean" + Return "Boolean" + } + ElseIf ($Script:IsInstanceValueType[$ObjectType]) + { + Write-Debug "Get-InstanceType ValueType" + Return "ValueType" + } + ElseIf ($Object -Is [System.Enum]) + { + Write-Debug "Get-InstanceType Enum" + Return "Enum" + } + Else + { + Write-Debug "Get-InstanceType Struct" + Return "Struct" + } + } + IF ($Object -Is [System.String]) + { + Write-Debug "Get-InstanceType String" + Return "String" + } + + IF ($Object -Is [System.Management.Automation.PSCustomObject]) + { + Write-Debug "Get-InstanceType PSObject" + Return "PSObject" + } + If (Get-IsCollection $Object) + { + If ($Object -Is [System.Array]) + { + Write-Debug "Get-InstanceType Array" + Return "Array" + } + ElseIf (Get-IsHashTable $Object) + { + Write-Debug "Get-InstanceType HashTable" + Return "HashTable" + } + Else + { + Write-Debug "Get-InstanceType Collection" + Return "Collection" + } + } + Else + { + Write-Debug "Get-InstanceType Object" + Return "Object" + } +} + +# Return boolean if object is collection (has GetNumerator) +Function Get-PropertyReturnType +{ + [CmdletBinding()] + [OutputType([String])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + $ObjectType=($Object.GetType()).FullName + Write-Verbose "Get-PropertyReturnType ObjectType=$ObjectType" + If ($Object -Is [System.ValueType]) + { + If ($Object -Is [System.Boolean]) + { + Write-Debug "Get-PropertyReturnType Boolean" + Return "Boolean" + } + ElseIf ($Script:IsPropertyValueType[$ObjectType]) + { + Write-Debug "Get-PropertyReturnType ValueType" + Return "ValueType" + } + ElseIf ($Object -Is [System.Enum]) + { + Write-Debug "Get-PropertyReturnType Enum" + Return "Enum" + } + Else + { + Write-Debug "Get-PropertyReturnType Struct" + Return "Struct" + } + } + IF ($Object -Is [System.String]) + { + Write-Debug "Get-PropertyReturnType String" + Return "String" + } + If (Get-IsCollection $Object) + { + If ($Object -Is [System.Array]) + { + Write-Debug "Get-PropertyReturnType Array" + Return "Array" + } + ElseIf (Get-IsHashTable $Object) + { + Write-Debug "Get-PropertyReturnType HashTable" + Return "HashTable" + } + Else + { + Write-Debug "Get-PropertyReturnType Collection" + Return "Collection" + } + } + Else + { + Write-Debug "Get-PropertyReturnType Object" + Return "Object" + } +} + +# Gets instance name by trying various properties +Function Get-InstanceFriendlyName +{ + [CmdletBinding()] + [OutputType([string])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + Write-Debug "Get-InstanceFriendlyName Type=$($Object.GetType().FullName)" + If ($Object -Is [System.Enum]) + { + return "[$(($Object.GetType()).FullName)]::$Object" + } + If ($Object -Is [System.ValueType] -OR + $Object -Is [System.String] + ) + { + return "[$(($Object.GetType()).FullName)]$Object" + } + If ($Object -Is [System.Type]) + { + return "[$($Object.FullName)]" + } + If (Get-IsCollection $Object) + { + If ($Object -Is [System.Array]) + { + return "$(($Object.GetType()).FullName)" + } + Else + { + return "$(($Object.GetType()).FullName)" + } + } + Trap { Continue } + $Return="" + $Return=$Object.Name + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.DisplayName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.DeviceName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.DeviceID + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Text + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Tag + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Caption + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Action + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.SameElement + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Element + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.PartComponent + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.ASPScriptDefaultNamespace + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Antecedent + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Dependent + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.FullName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.FullPath + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.CodeFragment + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Key + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.ModuleName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Verb + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.ShareName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.InstanceName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.GetType() + IF ($Return -NE "") { Return $Return} +} + +# Gets object name by trying various properties +Function Get-PropertyFriendlyName +{ + [CmdletBinding()] + [OutputType([string])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + Write-Debug "Get-PropertyFriendlyName Type=$($Object.GetType().FullName)" + If ($Object -Is [System.Enum]) + { + return "[$(($Object.GetType()).FullName)]::$Object" + } + If ($Object -Is [System.ValueType] -OR + $Object -Is [System.String] + ) + { + return "[$(($Object.GetType()).Name)]$Object" + } + If ($Object -Is [System.Type]) + { + return "[$($Object.FullName)]" + } + If (Get-IsCollection $Object) + { + If ($Object -Is [System.Array]) + { + return "$(($Object.GetType()).Name).Count=$($Object.Count)" + } + Else + { + return "$(($Object.GetType()).Name).Count=$($Object.Count)" + } + } + Trap { Continue } + $Return="" + $Return=$Object.Name + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.DisplayName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.DeviceName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.DeviceID + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Text + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Tag + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Caption + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Action + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.SameElement + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Element + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.PartComponent + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.ASPScriptDefaultNamespace + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Antecedent + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Dependent + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.FullName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.FullPath + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.CodeFragment + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Key + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.ModuleName + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.Verb + IF ($Return.Length -GT 0) { Return $Return} + $Return=$Object.GetType() + IF ($Return -NE "") { Return $Return} +} + +#endregion + +#Adds a treeview node for an object +Function Add-Node +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$Object, + [parameter(Mandatory=$False, + Position=1)] + [String]$Name=(Get-InstanceFriendlyName $Object) + ) + Try + { + Write-Debug "Add-Node $($Object.GetType()) $Name" + Add-TreeNode $TreeViewInstance $Object $Name + } + Catch [System.Exception] + { + Write-Verbose "Add-Node Catch" + Write-Verbose $_.Exception.Message + } +} + +#Adds a treeview node for an object to an existing node +Function Add-TreeNode +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$ParentNode, + [parameter(Mandatory=$True, + Position=1)] + [Object]$Object, + [parameter(Mandatory=$False, + Position=2)] + [String]$Name=(Get-InstanceFriendlyName $Object) + ) + Try + { + Write-Debug "Add-TreeNode $($Object.GetType()) $Name" + $Node=$ParentNode.Nodes.Add((Get-NextKey)+" "+$Name,$Name) + $Node.Tag = $Object + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-TreeNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#Adds a treeview node for a collection to an existing node +Function Add-TreeNodes +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$ParentNode, + [parameter(Mandatory=$True, + Position=1)] + [Object]$Objects, + [parameter(Mandatory=$True, + Position=2)] + [String]$Name + ) + Try + { + Write-Debug "Add-TreeNodes" + $Node=$ParentNode.Nodes.Add((Get-NextKey)+" "+$Name,$Name) + $Node.Tag = $Objects + ForEach($Object In $Objects) + { + $ChildNode =Add-TreeNode $Node $Object + } + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-TreeNodes Catch" + Write-Verbose $_.Exception.Message + } +} + +#Remove a treeview node +Function Remove-Node +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$Node + ) + Try + { + Write-Verbose "Remove-Node" + IF ($Node -NE $Null) + { + Remove-TreeNode $Node + } + } + Catch [System.Exception] + { + Write-Verbose "Remove-Node Catch" + Write-Verbose $_.Exception.Message + } +} + +#Remove a treeview node +Function Remove-TreeNode +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$Node + ) + Try + { + Write-Verbose "Remove-TreeNode" + IF ($Node -NE $Null) + { + $Node.Nodes.Clear() + $Node.Remove() + Write-Verbose "Removed-TreeNode" + } + } + Catch [System.Exception] + { + Write-Verbose "Remove-TreeNode Catch" + Write-Verbose $_.Exception.Message + } +} + + +#region WMIObjects + +# Determines whether object is an WMI object +Function Get-IsWMIObject +{ + [CmdletBinding()] + [OutputType([string])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + Write-Debug "Get-IsWMIObject" + Try + { + If($Object.IsWMIObject -EQ $True) + { + Return $True + } + Else + { + Return $False + } + } + Catch + { + Return $False + } +} +# Determines whether a node is an WMI object type or an object +Function Get-WMIObjectType +{ + [CmdletBinding()] + [OutputType([string])] + param ( + [parameter(Mandatory=$True)] + [Object]$Object + ) + Trap { Continue } + If ($Object.IsWMIClass) + { + Return "WMIClass" + } + ElseIf ($Object.IsWMISubCategory) + { + Return "WMISubCategory" + } + ElseIf ($Object.IsWMICategory) + { + Return "WMICategory" + } + ElseIf ($Object.IsWMIRoot) + { + Return "WMIRoot" + } + Else + { + Return "Unknown Object" + } +} +#Adds a treeview node for a WMI object type mode +Function Add-WMITreeNode +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$TreeView, + [parameter(Mandatory=$True, + Position=1)] + [String]$Category, + [parameter(Mandatory=$True, + Position=2)] + [String]$SubCategory, + [parameter(Mandatory=$True, + Position=3)] + [String]$Class, + [parameter(Mandatory=$True, + Position=4)] + [String]$Description + ) + [int]$PC = $Script:WMIClasses.Count / 4.80 + TRY + { + If ($Category -EQ "WMIRoot") #WMIRoot + { + Write-Verbose "Add-WMITreeNode WMIRoot" + Write-Progress -Activity "Adding WMI Root" -PercentComplete $PC -Status "Working ..." + $PSObject = New-Object PSObject -Property ([Ordered]@{ + Category="Win32 Classes" + Description="WMI Win32 Classes" + IsWMIObject=$True + IsWMIRoot=$True + }) + $Script:WMIRootNode = $TreeView.Nodes.Insert(0,((Get-NextKey)+" " +$PSObject.Category),$PSObject.Category) + $Script:WMIRootNode.Tag = $PSObject + $Script:WMIRootNode.EnsureVisible() + } + ElseIf ($SubCategory -EQ " ") #WMICateogry + { + Write-Verbose "Add-WMITreeNode Category=$Category" + Write-Progress -Activity "Adding Category $Category" -PercentComplete $PC -Status "Working ..." + $PSOBject = New-Object PSObject -Property ([Ordered]@{ + Category=$Category + Description=$Description + IsWMIObject=$True + IsWMICategory=$True + }) + $Script:WMICategoryNode = $Script:WMIRootNode.Nodes.Add(((Get-NextKey)+" " +$Category),$Category) + $Script:WMICategoryNode.Tag = $PSObject + } + ElseIf ($Class -EQ " ") #WMISubCategory + { + Write-Verbose "Add-WMITreeNode SubCategory=$SubCategory" + Write-Progress -Activity "Adding SubCategory $SubCategory" -PercentComplete $PC -Status "Working ..." + $PSOBject = New-Object PSObject -Property ([Ordered]@{ + Category=$Category + SubCategory=$SubCategory + Description=$Description + IsWMIObject=$True + IsWMICategory=$False + IsWMISubCategory=$True + }) + $Script:WMISubCategoryNode = $Script:WMICategoryNode.Nodes.Add(((Get-NextKey)+" "+$SubCategory),$SubCategory) + $Script:WMISubCategoryNode.Tag = $PSObject + } + Else #WMIClass + { + Write-Verbose "Add-WMITreeNode Class=$Class" + Write-Progress -Activity "Adding Class $Class" -PercentComplete $PC -Status "Working ..." + $PSOBject = New-Object PSObject -Property ([Ordered]@{ + Category=$Category + SubCategory=$SubCategory + Class=$Class + Description=$Description + IsWMIObject=$True + IsWMICategory=$False + IsWMISubCategory=$False + IsWMIClass=$True + }) + $ClassNode = $Script:WMISubCategoryNode.Nodes.Add(((Get-NextKey)+" "+$Class),$Class) + $ClassNode.Tag = $PSObject + $Script:WMIClasses.Add($Class,$PSObject) + } + } + Catch [System.Exception] + { + Write-Verbose "Add-WMITreeNode Catch" + Write-Verbose $_.Exception.Message + } +} +#Adds treeview nodes for WMI classes sort by Name +Function Add-WMITreeNodesOrderedByName +{ + [CmdletBinding()] + param () + [Double]$PCINC = (1/$Script:WMIClasses.Count) * 100 + [Double]$PC = 100 + TRY + { + Write-Verbose "Add-WMITreeNodesOrderedByName Adding Category" + $SubCategory="WMI Classes By Name" + $PSOBject = New-Object PSObject -Property ([Ordered]@{ + Category=$SubCategory + SubCategory=$SubCategory + Description="WMI Classes sorted by Name." + IsWMIObject=$True + IsWMICategory=$False + IsWMISubCategory=$True + }) + Write-Progress -Activity "Adding sorted subcategory $SubCategory" -PercentComplete $PC -Status "Working ..." + $SubCategoryNode = $Script:WMIRootNode.Nodes.Add(((Get-NextKey)+" "+$SubCategory),$SubCategory) + $SubCategoryNode.Tag = $PSObject + $SubCategoryNode + + Write-Verbose "Sorting WMIClasses" + $Win32Classes = $Script:WMIClasses.GetEnumerator() | Sort -Property Key + + For ($I=0;$I -LT $WIN32classes.Count;$I++) + { + $PC=$PC-$PCINC + $Class=$Win32Classes[$I].Key + Write-Progress -Activity "Adding sorted class $Class" -PercentComplete $PC -Status "Working ..." + $ClassNode = $SubCategoryNode.Nodes.Add(((Get-NextKey)+" "+$Class),$Class) + $ClassNode.Tag = $Win32Classes[$I].Value + } + } + Catch [System.Exception] + { + Write-Verbose "Add-WMITreeNodesOrderedByName Catch" + Write-Verbose $_.Exception.Message + } +} +#Adds treeview nodes for WMI objects +Function Add-WMITreeNodes +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$TreeView + ) + Try + { + Write-Verbose "Add-WMITreeNodes TreeView.Name=$($TreeView.Name)" + Write-Progress -Activity "Adding WMIClasses" -PercentComplete 0 -Status "Working ..." + $Script:WMIClasses = @{} + Add-WMITreeNode $TreeView "WMIRoot" " " " " " " + Add-WMITreeNode $TreeView "Computer System Hardware Classes" " " " " "Hardware-related objects." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Cooling Device Classes" " " "The Cooling Devices subcategory groups classes that represent instrumentable fans, temperature probes, and refrigeration devices." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Cooling Device Classes" "Win32_Fan" "Represents the properties of a fan device in the computer system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Cooling Device Classes" "Win32_HeatPipe" "Represents the properties of a heat pipe cooling device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Cooling Device Classes" "Win32_Refrigeration" "Represents the properties of a refrigeration device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Cooling Device Classes" "Win32_TemperatureProbe" "Represents the properties of a temperature sensor (electronic thermometer)." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Input Device Classes" " " "The Input Devices subcategory groups classes that represent keyboards and pointing devices." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Input Device Classes" "Win32_Keyboard" "Represents a keyboard installed on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Input Device Classes" "Win32_PointingDevice" "Represents an input device used to point to and select regions on the display of a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Mass Storage Classes" " " "Classes in the Mass Storage subcategory represent storage devices such as hard disk drives, CD-ROM drives, and tape drives." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Mass Storage Classes" "Win32_AutochkSetting" "Represents the settings for the autocheck operation of a disk." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Mass Storage Classes" "Win32_CDROMDrive" "Represents a CD-ROM drive on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Mass Storage Classes" "Win32_DiskDrive" "Represents a physical disk drive as seen by a computer running the Windows operating system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Mass Storage Classes" "Win32_FloppyDrive" "Manages the capabilities of a floppy disk drive." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Mass Storage Classes" "Win32_PhysicalMedia" "Represents any type of documentation or storage medium." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Mass Storage Classes" "Win32_TapeDrive" "Represents a tape drive on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" " " "The Motherboard, Controllers, and Ports subcategory groups classes that represent system devices. Examples include system memory, cache memory, and controllers." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_1394Controller" "Represents the capabilities and management of a 1394 controller." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_1394ControllerDevice" "Relates the high-speed serial bus (IEEE 1394 Firewire) Controller and the CIM_LogicalDevice instance connected to it." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_AllocatedResource" "Relates a logical device to a system resource." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_AssociatedProcessorMemory" "Relates a processor and its cache memory." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_BaseBoard" "Represents a baseboard (also known as a motherboard or system board)." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_BIOS" "Represents the attributes of the computer system's basic input or output services (BIOS) that are installed on the computer." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_Bus" "Represents a physical bus as seen by a Windows operating system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_CacheMemory" "Represents cache memory (internal and external) on a computer system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_ControllerHasHub" "Represents the hubs downstream from the universal serial bus (USB) controller." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_DeviceBus" "Relates a system bus and a logical device using the bus." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_DeviceMemoryAddress" "Represents a device memory address on a Windows system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_DeviceSettings" "Relates a logical device and a setting that can be applied to it." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_DMAChannel" "Represents a direct memory access (DMA) channel on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_FloppyController" "Represents the capabilities and management capacity of a floppy disk drive controller." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_IDEController" "Represents the capabilities of an Integrated Drive Electronics (IDE) controller device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_IDEControllerDevice" "Association class that relates an IDE controller and the logical device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_InfraredDevice" "Represents the capabilities and management of an infrared device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_IRQResource" "Represents an interrupt request line (IRQ) number on a Windows computer system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_MemoryArray" "Represents the properties of the computer system memory array and mapped addresses." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_MemoryArrayLocation" "Relates a logical memory array and the physical memory array upon which it exists." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_MemoryDevice" "Represents the properties of a computer system's memory device along with its associated mapped addresses." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_MemoryDeviceArray" "Relates a memory device and the memory array in which it resides." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_MemoryDeviceLocation" "Association class that relates a memory device and the physical memory on which it exists." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_MotherboardDevice" "Represents a device that contains the central components of the computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_OnBoardDevice" "Represents common adapter devices built into the motherboard (system board)." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_ParallelPort" "Represents the properties of a parallel port on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PCMCIAController" "Manages the capabilities of a Personal Computer Memory Card Interface Adapter (PCMCIA) controller device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PhysicalMemory" "Represents a physical memory device located on a computer as available to the operating system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PhysicalMemoryArray" "Represents details about the computer system's physical memory." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PhysicalMemoryLocation" "Relates an array of physical memory and its physical memory." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PNPAllocatedResource" "Represents an association between logical devices and system resources." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PNPDevice" "Relates a device (known to Configuration Manager as a PNPEntity), and the function it performs." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PNPEntity" "Represents the properties of a Plug and Play device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PortConnector" "Represents physical connection ports, such as DB-25 pin male, Centronics, and PS/2." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_PortResource" "Represents an I/O port on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_Processor" "Represents a device capable of interpreting a sequence of machine instructions on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SCSIController" "Represents a small computer system interface (SCSI) controller on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SCSIControllerDevice" "Relates a SCSI controller and the logical device (disk drive) connected to it." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SerialPort" "Represents a serial port on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SerialPortConfiguration" "Represents the settings for data transmission on a Windows serial port." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SerialPortSetting" "Relates a serial port and its configuration settings." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SMBIOSMemory" "Represents the capabilities and management of memory-related logical devices." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SoundDevice" "Represents the properties of a sound device on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SystemBIOS" "Relates a computer system (including data such as startup properties, time zones, boot configurations, or administrative passwords) and a system BIOS (services, languages, and system management properties)." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SystemDriverPNPEntity" "Relates a Plug and Play device on the Windows computer system and the driver that supports the Plug and Play device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SystemEnclosure" "Represents the properties associated with a physical system enclosure." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SystemMemoryResource" "Represents a system memory resource on a Windows system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_SystemSlot" "Represents physical connection points including ports, motherboard slots and peripherals, and proprietary connections points." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_USBController" "Manages the capabilities of a universal serial bus (USB) controller." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_USBControllerDevice" "Relates a USB controller and the CIM_LogicalDevice instances connected to it." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Motherboard, Controller, and Port Classes" "Win32_USBHub" "Represents the management characteristics of a USB hub." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Networking Device Classes" " " "The Networking Devices subcategory groups classes that represent the network interface controller, its configurations, and its settings." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Networking Device Classes" "Win32_NetworkAdapter" "Represents a network adapter on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Networking Device Classes" "Win32_NetworkAdapterConfiguration" "Represents the attributes and behaviors of a network adapter. The class is not guaranteed to be supported after the ratification of the Distributed Management Task Force (DMTF) CIM network specification." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Networking Device Classes" "Win32_NetworkAdapterSetting" "Relates a network adapter and its configuration settings." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Power Classes" " " "The Power subcategory groups classes that represent power supplies, batteries, and events related to these devices." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Power Classes" "Win32_AssociatedBattery" "Relates a logical device and the battery it is using." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Power Classes" "Win32_Battery" "Represents a battery connected to the computer system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Power Classes" "Win32_CurrentProbe" "Represents the properties of a current monitoring sensor (ammeter)." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Power Classes" "Win32_PortableBattery" "Represents the properties of a portable battery, such as one used for a notebook computer." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Power Classes" "Win32_PowerManagementEvent" "Represents power management events resulting from power state changes." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Power Classes" "Win32_UninterruptiblePowerSupply" "Represents the capabilities and management capacity of an uninterruptible power supply (UPS)." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Power Classes" "Win32_VoltageProbe" "Represents the properties of a voltage sensor (electronic voltmeter)." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" " " "The Printing subcategory groups classes that represent printers, printer configurations, and print jobs." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_DriverForDevice" "Relates a printer to a printer driver." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_Printer" "Represents a device connected to a computer system running Windows that is capable of reproducing a visual image on a medium." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_PrinterConfiguration" "Defines the configuration for a printer device." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_PrinterController" "Relates a printer and the local device to which the printer is connected." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_PrinterDriver" "Represents the drivers for a Win32_Printer instance." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_PrinterDriverDll" "Relates a local printer and its driver file (not the driver itself)." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_PrinterSetting" "Relates a printer and its configuration settings." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_PrintJob" "Represents a print job generated by a Windows-based application." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Printing Classes" "Win32_TCPIPPrinterPort" "Represents a TCP/IP service access point." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Telephony Classes" " " "The Telephony subcategory groups classes that represent ""plain old telephone"" modem devices and their associated serial connections." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Telephony Classes" "Win32_POTSModem" "Represents the services and characteristics of a Plain Old Telephone Service (POTS) modem on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Telephony Classes" "Win32_POTSModemToSerialPort" "Relates a modem and the serial port the modem uses." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Video and Monitor Classes" " " "The Video and Monitors subcategory groups classes that represent monitors, video cards, and their associated settings." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Video and Monitor Classes" "Win32_DesktopMonitor" "Represents the type of monitor or display device attached to the computer system." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Video and Monitor Classes" "Win32_DisplayConfiguration" "Represents configuration information for the display device on a computer system running Windows. This class is obsolete. In place of this class, use the properties in the Win32_VideoController, Win32_DesktopMonitor, and CIM_VideoControllerResolution classes." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Video and Monitor Classes" "Win32_DisplayControllerConfiguration" "Represents the video adapter configuration information of a computer system running Windows. This class is obsolete. In place of this class, use the properties in the Win32_VideoController, Win32_DesktopMonitor, and CIM_VideoControllerResolution classes." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Video and Monitor Classes" "Win32_VideoController" "Represents the capabilities and management capacity of the video controller on a computer system running Windows." + Add-WMITreeNode $TreeView "Computer System Hardware Classes" "Video and Monitor Classes" "Win32_VideoSettings" "Relates a video controller and video settings that can be applied to it." + Add-WMITreeNode $TreeView "Operating System Classes" " " " " "Operating system related objects." + Add-WMITreeNode $TreeView "Operating System Classes" "Desktop" " " "The Desktop subcategory groups classes that represent objects that define a specific desktop configuration." + Add-WMITreeNode $TreeView "Operating System Classes" "Desktop" "Win32_Desktop" "Represents the common characteristics of a user's desktop." + Add-WMITreeNode $TreeView "Operating System Classes" "Desktop" "Win32_Environment" "Represents an environment or system environment setting on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Desktop" "Win32_TimeZone" "Represents the time zone information for a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Desktop" "Win32_UserDesktop" "Relates a user account and the desktop settings that are specific to it." + Add-WMITreeNode $TreeView "Operating System Classes" "Drivers" " " "The Drivers subcategory groups classes that represent virtual device drivers and system drivers for base services." + Add-WMITreeNode $TreeView "Operating System Classes" "Drivers" "Win32_DriverVXD" "Represents a virtual device driver on a Windows computer system." + Add-WMITreeNode $TreeView "Operating System Classes" "Drivers" "Win32_SystemDriver" "Represents the system driver for a base service." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" " " "The File System subcategory groups classes that represent the way a hard disk is logically arranged. This includes the type of file system used, the directory structure, and way the disk is partitioned." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_CIMLogicalDeviceCIMDataFile" "Relates logical devices and data files, indicating the driver files used by the device." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_Directory" "Represents a directory entry on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_DirectorySpecification" "Represents the directory layout for the product." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_DiskDriveToDiskPartition" "Relates a disk drive and a partition existing on it." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_DiskPartition" "Represents the capabilities and management capacity of a partitioned area of a physical disk on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_DiskQuota" "Tracks disk space usage for NTFS file system volumes." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_LogicalDiskRootDirectory" "Relates a logical disk and its directory structure." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_LogicalDiskToPartition" "Relates a logical disk drive and the disk partition it resides on." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_OperatingSystemAutochkSetting" "Represents the association between a CIM_ManagedSystemElement instance and the settings defined for it." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_QuotaSetting" "Contains setting information for disk quotas on a volume." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_ShortcutFile" "Represents files that are shortcuts to other files, directories, and commands." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_SubDirectory" "Relates a directory (folder) and one of its subdirectories (subfolders)." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_SystemPartitions" "Relates a computer system and a disk partition on that system." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_Volume" "Represents an area of storage on a hard disk." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_VolumeQuota" "Relates a volume to the per volume quota settings." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_VolumeQuotaSetting" "Relates disk quota settings with a specific disk volume." + Add-WMITreeNode $TreeView "Operating System Classes" "File System" "Win32_VolumeUserQuota" "Relates per user quotas to quota-enabled volumes." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_TypeLibraryAction" "Operating System Classes" + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_TypeLibraryAction" "Operating system related objects." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" " " "Software-related objects." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ClassicCOMApplicationClasses" "Association class" + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ClassicCOMApplicationClasses" "Relates a DCOM application and a COM component grouped under it." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ClassicCOMClass" "Represents the properties of a COM component." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ClassicCOMClassSettings" "Relates a COM class and the settings used to configure instances of the COM class." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ClientApplicationSetting" "Relates an executable and a DCOM application that contains the DCOM configuration options for the executable file." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_COMApplication" "Represents a COM application." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_COMApplicationClasses" "Relates a COM component and the COM application where it resides." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_COMApplicationSettings" "Relates a DCOM application and its configuration settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_COMClass" "Represents the properties of a COM component." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ComClassAutoEmulator" "Relates a COM class and another COM class that it automatically emulates." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ComClassEmulator" "Relates two versions of a COM class." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ComponentCategory" "Represents a component category." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_COMSetting" "Represents the settings associated with a COM component or COM application." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_DCOMApplication" "Represents the properties of a DCOM application." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_DCOMApplicationAccessAllowedSetting" "Relates the Win32_DCOMApplication instance and the user security identifications (SID) that can access it." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_DCOMApplicationLaunchAllowedSetting" "Relates the Win32_DCOMApplication instance and the user SIDs that can launch it." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_DCOMApplicationSetting" "Represents the settings of a DCOM application." + Add-WMITreeNode $TreeView "Operating System Classes" "Installed Applications Classes" "Win32_ImplementedCategory" "Relates a component category and the COM class using its interfaces." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" " " "The Job Objects subcategory groups classes that represent classes that provide the means of instrumenting named job objects. An unnamed job object cannot be instrumented." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_CollectionStatistics" "Relates a managed system element collection and the class representing statistical information about the collection." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_LUID" "Represents a locally unique identifier (LUID)" + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_LUIDandAttributes" "Represents a LUID and its attributes." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_NamedJobObject" "Represents a kernel object that is used to group processes for the sake of controlling the life and resources of the processes within the job object." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_NamedJobObjectActgInfo" "Represents the I/O accounting information for a job object." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_NamedJobObjectLimit" "Represents an association between a job object and the job object limit settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_NamedJobObjectLimitSetting" "Represents the limit settings for a job object." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_NamedJobObjectProcess" "Relates a job object and the process contained in the job object." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_NamedJobObjectSecLimit" "Relates a job object and the job object security limit settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_NamedJobObjectSecLimitSetting" "Represents the security limit settings for a job object." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_NamedJobObjectStatistics" "Represents an association between a job object and the job object I/O accounting information class." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_SIDandAttributes" "Represents a security identifier (SID) and its attributes." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_TokenGroups" "Represents information about the group SIDs in an access token." + Add-WMITreeNode $TreeView "Operating System Classes" "Job Objects" "Win32_TokenPrivileges" "Represents information about a set of privileges for an access token." + Add-WMITreeNode $TreeView "Operating System Classes" "Memory and Page Files" " " "The Memory and Page files subcategory groups classes that represent page file configuration settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Memory and Page Files" "Win32_LogicalMemoryConfiguration" "This class is obsolete and has been replaced by the Win32_OperatingSystem class." + Add-WMITreeNode $TreeView "Operating System Classes" "Memory and Page Files" "Win32_PageFile" "Represents the file used for handling virtual memory file swapping on a Windows system." + Add-WMITreeNode $TreeView "Operating System Classes" "Memory and Page Files" "Win32_PageFileElementSetting" "Relates the initial settings of a page file and the state of those settings during normal use." + Add-WMITreeNode $TreeView "Operating System Classes" "Memory and Page Files" "Win32_PageFileSetting" "Represents the settings of a page file." + Add-WMITreeNode $TreeView "Operating System Classes" "Memory and Page Files" "Win32_PageFileUsage" "Represents the file used for handling virtual memory file swapping on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Memory and Page Files" "Win32_SystemLogicalMemoryConfiguration" "This class is obsolete because the properties existing in the Win32_LogicalMemoryConfiguration class are now a part of the Win32_OperatingSystem class." + Add-WMITreeNode $TreeView "Operating System Classes" "Multimedia Audio or Visual" " " "The class in the Multimedia Audio or Visual subcategory represents properties of the audio or video codec installed on the computer system." + Add-WMITreeNode $TreeView "Operating System Classes" "Multimedia Audio or Visual" "Win32_CodecFile" "Represents the audio or video codec installed on the computer system." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" " " "The Networking subcategory groups classes that represent network connections, network clients, and network connection settings such as the protocol used." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_ActiveRoute" "Relates the current IP4 route to the persisted IP route table." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_IP4PersistedRouteTable" "Represents persisted IP routes." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_IP4RouteTable" "Represents information that governs the routing of network data packets." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_IP4RouteTableEvent" "Represents IP route change events." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_NetworkClient" "Represents a network client on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_NetworkConnection" "Represents an active network connection in a Windows environment." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_NetworkProtocol" "Represents a protocol and its network characteristics on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_NTDomain" "Represents a Windows NT domain." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_PingStatus" "Represents the values returned by the standard ping command." + Add-WMITreeNode $TreeView "Operating System Classes" "Networking" "Win32_ProtocolBinding" "Relates a system-level driver, network protocol, and network adapter." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" " " "The Operating System Events subcategory groups classes that represent events in the operating system related to processes, threads, and system shutdown." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ComputerShutdownEvent" "Represents computer shutdown events." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ComputerSystemEvent" "Represents events related to a computer system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_DeviceChangeEvent" "Represents device change events resulting from the addition, removal, or modification of devices on the computer system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ModuleLoadTrace" "Indicates that a process has loaded a new module." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ModuleTrace" "Base event for module events." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ProcessStartTrace" "Indicates that a new process has started." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ProcessStopTrace" "Indicates that a process has terminated." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ProcessTrace" "Base event for process events." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_SystemConfigurationChangeEvent" "Indicates that the device list on the system has been refreshed (a device has been added or removed, or the configuration changed)." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_SystemTrace" "Base class for all system trace events, including module, process, and thread traces." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ThreadStartTrace" "Indicates a new thread has started." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ThreadStopTrace" "Indicates that a thread has stopped." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_ThreadTrace" "Base event class for thread events." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Events" "Win32_VolumeChangeEvent" "Represents a network-mapped drive event resulting from the addition of a network drive letter or mounted drive on the computer system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" " " "The Operating System Settings subcategory groups classes that represent the Operating System and its settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_BootConfiguration" "Represents the boot configuration of a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_ComputerSystem" "Represents a computer system operating in a Windows environment." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_ComputerSystemProcessor" "Relates a computer system and a processor running on that system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_ComputerSystemProduct" "Represents a product." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_DependentService" "Relates two interdependent base services." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_LoadOrderGroup" "Represents a group of system services that define execution dependencies." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_LoadOrderGroupServiceDependencies" "Represents an association between a base service and a load order group that the service depends on to start running." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_LoadOrderGroupServiceMembers" "Relates a load order group and a base service." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_OperatingSystem" "Represents an operating system installed on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_OperatingSystemQFE" "Relates an operating system and product updates applied as represented in Win32_QuickFixEngineering." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_OSRecoveryConfiguration" "Represents the types of information that will be gathered from memory when the operating system fails." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_QuickFixEngineering" "Represents system-wide Quick Fix Engineering (QFE) or updates that have been applied to the current operating system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_StartupCommand" "Represents a command that runs automatically when a user logs onto the computer system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemBootConfiguration" "Relates a computer system and its boot configuration." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemDesktop" "Relates a computer system and its desktop configuration." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemDevices" "Relates a computer system and a logical device installed on that system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemLoadOrderGroups" "Relates a computer system and a load order group." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemNetworkConnections" "Relates a network connection and the computer system on which it resides." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemOperatingSystem" "Relates a computer system and its operating system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemProcesses" "Relates a computer system and a process running on that system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemProgramGroups" "Relates a computer system and a logical program group." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemResources" "Relates a system resource and the computer system it resides on." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemServices" "Relates a computer system and a service program that exists on the system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemSetting" "Relates a computer system and a general setting on that system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemSystemDriver" "Relates a computer system and a system driver running on that computer system." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemTimeZone" "Relates a computer system and a time zone." + Add-WMITreeNode $TreeView "Operating System Classes" "Operating System Settings" "Win32_SystemUsers" "Relates a computer system and a user account on that system." + Add-WMITreeNode $TreeView "Operating System Classes" "Processes" " " "The Processes subcategory groups classes that represent system processes and threads." + Add-WMITreeNode $TreeView "Operating System Classes" "Processes" "Win32_Process" "Represents a sequence of events on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Processes" "Win32_ProcessStartup" "Represents the startup configuration of a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Processes" "Win32_Thread" "Represents a thread of execution." + Add-WMITreeNode $TreeView "Operating System Classes" "Registry" " " "The class in the Registry subcategory represents the contents of the Windows registry." + Add-WMITreeNode $TreeView "Operating System Classes" "Registry" "Win32_Registry" "Represents the system registry on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Scheduler Jobs" " " "The Scheduler Jobs subcategory groups classes that represent scheduled job settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Scheduler Jobs" "Win32_CurrentTime" "Represents an instance in time as component seconds, minutes, day of the week, and so on." + Add-WMITreeNode $TreeView "Operating System Classes" "Scheduler Jobs" "Win32_ScheduledJob" "Represents a job scheduled using the Windows schedule service." + Add-WMITreeNode $TreeView "Operating System Classes" "Scheduler Jobs" "Win32_LocalTime" "Represents a point in time returned as Win32_LocalTime objects that result from a query. The Hour property is returned as the local time in a 24-hour clock." + Add-WMITreeNode $TreeView "Operating System Classes" "Scheduler Jobs" "Win32_UTCTime" "Represents a point in time that is returned as Win32_UTCTime objects that result from a query. The Hour property is returned as the coordinated universal time (UTC) time in a 24?hour clock." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" " " "The Security subcategory groups classes that represent system security settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_AccountSID" "Relates a security account instance with a security descriptor instance." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_ACE" "Represents an access control entry (ACE)." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_LogicalFileAccess" "Relates the security settings of a file or directory and one member of its discretionary access control list (DACL)." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_LogicalFileAuditing" "Relates the security settings of a file or directory one member of its system access control list (SACL)." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_LogicalFileGroup" "Relates the security settings of a file or directory and its group." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_LogicalFileOwner" "Relates the security settings of a file or directory and its owner." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_LogicalFileSecuritySetting" "Represents security settings for a logical file." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_LogicalShareAccess" "Relates the security settings of a share and one member of its DACL." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_LogicalShareAuditing" "Relates the security settings of a share and one member of its SACL." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_LogicalShareSecuritySetting" "Represents security settings for a logical file." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_PrivilegesStatus" "Represents information about the privileges required to complete an operation." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecurityDescriptor" "Represents a structural representation of a SECURITY_DESCRIPTOR." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecuritySetting" "Represents security settings for a managed element." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecuritySettingAccess" "Represents the rights granted and denied to a trustee for a given object." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecuritySettingAuditing" "Represents the auditing for a given trustee on a given object." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecuritySettingGroup" "Relates the security of an object and its group." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecuritySettingOfLogicalFile" "Represents security settings of a file or directory object." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecuritySettingOfLogicalShare" "Represents security settings of a shared object." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecuritySettingOfObject" "Relates an object to its security settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SecuritySettingOwner" "Relates the security settings of an object and its owner." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_SID" "Represents an arbitrary SID." + Add-WMITreeNode $TreeView "Operating System Classes" "Security" "Win32_Trustee" "Represents a trustee." + Add-WMITreeNode $TreeView "Operating System Classes" "Services" " " "The Services subcategory groups classes that represent services and base services." + Add-WMITreeNode $TreeView "Operating System Classes" "Services" "Win32_BaseService" "Represents executable objects that are installed in a registry database maintained by the Service Control Manager." + Add-WMITreeNode $TreeView "Operating System Classes" "Services" "Win32_Service" "Represents a service on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" " " "The Shares subcategory groups classes that represent details of shared resources, such as printers and folders." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_DFSNode" "Represents a root or junction node of a domain-based or stand-alone distributed file system (DFS)." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_DFSNodeTarget" "Represents the relationship of a DFS node to one of its targets." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_DFSTarget" "Represents the target of a DFS node." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_ServerConnection" "Represents the connections made from a remote computer to a shared resource on the local computer." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_ServerSession" "Represents the sessions that are established with the local computer by users on a remote computer." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_ConnectionShare" "Relates a shared resource on the computer and the connection made to the shared resource." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_PrinterShare" "Relates a local printer and the share that represents it as it is viewed over a network." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_SessionConnection" "Represents an association between a session established with the local server by a user on a remote machine, and the connections that depend on the session." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_SessionProcess" "Represents an association between a logon session and the processes associated with that session." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_ShareToDirectory" "Relates a shared resource on the computer system and the directory to which it is mapped." + Add-WMITreeNode $TreeView "Operating System Classes" "Shares" "Win32_Share" "Represents a shared resource on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" " " "The Start Menu subcategory groups classes that represent program groups." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" "Win32_LogicalProgramGroup" "Represents a program group in a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" "Win32_LogicalProgramGroupDirectory" "Relates logical program groups (groupings in the Start menu), and the file directories in which they are stored." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" "Win32_LogicalProgramGroupItem" "Represents an element contained by a Win32_ProgramGroup instance, that is not itself another Win32_ProgramGroup instance." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" "Win32_LogicalProgramGroupItemDataFile" "Relates the program group items of the Start menu, and the files in which they are stored." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" "Win32_ProgramGroup" "Deprecated." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" "Win32_ProgramGroup" "Represents a program group in a Windows computer system. This class has been deprecated in favor of the Win32_LogicalProgramGroup class." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" "Win32_ProgramGroupContents" "Relates a program group order and an individual program group or item contained in it." + Add-WMITreeNode $TreeView "Operating System Classes" "Start Menu" "Win32_ProgramGroupOrItem" "Represents a logical grouping of programs on the user's Start|Programs menu." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" " " "The Users subcategory groups classes that represent storage information." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowBy" "Represents the association between a shadow copy and the provider that creates the shadow copy." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowContext" "Specifies how a shadow copy is to be created, queried, or deleted." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowCopy" "Represents a duplicate copy of the original volume at a previous time." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowDiffVolumeSupport" "Represents an association between a shadow copy provider and a storage volume." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowFor" "Represents an association between a shadow copy and the volume for which the shadow copy is created." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowOn" "Represents an association between a shadow copy and where the differential data is written." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowProvider" "Represents a component that creates and represents volume shadow copies." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowStorage" "Represents an association between a shadow copy and where the differential data is written." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_ShadowVolumeSupport" "Represents an association between a shadow copy provider with a supported volume." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_Volume" "Represents an area of storage on a hard disk." + Add-WMITreeNode $TreeView "Operating System Classes" "Storage" "Win32_VolumeUserQuota" "Represents a volume to the per volume quota settings." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" " " "The Users subcategory groups classes that represent user account information, such as group membership details." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_Account" "Represents information about user accounts and group accounts known to the computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_Group" "Represents data about a group account." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_GroupInDomain" "Identifies the group accounts associated with a Windows NT domain." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_GroupUser" "Relates a group and an account that is a member of that group." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_LogonSession" "Describes the logon session or sessions associated with a user logged on to Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_LogonSessionMappedDisk" "Represents the mapped logical disks associated with the session." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_NetworkLoginProfile" "Represents the network login information of a specific user on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_SystemAccount" "Represents a system account." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_UserAccount" "Represents information about a user account on a computer system running Windows." + Add-WMITreeNode $TreeView "Operating System Classes" "Users" "Win32_UserInDomain" "Relates a user account and a Windows NT domain." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Event Log" " " "The Windows Event Log subcategory groups classes that represent events, event log entries, event log configuration settings, and so on." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Event Log" "Win32_NTEventlogFile" "Represents data stored in a Windows Event log file." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Event Log" "Win32_NTLogEvent" "Represents Windows events." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Event Log" "Win32_NTLogEventComputer" "Relates instances of Win32_NTLogEvent and Win32_ComputerSystem." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Event Log" "Win32_NTLogEventLog" "Relates instances of Win32_NTLogEvent and Win32_NTEventlogFile classes." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Event Log" "Win32_NTLogEventUser" "Relates instances of Win32_NTLogEvent and Win32_UserAccount." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Product Activation" " " "Windows Product Activation (WPA) is an antipiracy technology to reduce the casual copying of software." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Product Activation" "Win32_ComputerSystemWindowsProductActivationSetting" "Relates instances of Win32_ComputerSystem and Win32_WindowsProductActivation." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Product Activation" "Win32_Proxy" "Contains properties and methods to query and configure an Internet connection related to WPA." + Add-WMITreeNode $TreeView "Operating System Classes" "Windows Product Activation" "Win32_WindowsProductActivation" "Contains properties and methods related to WPA." + Add-WMITreeNode $TreeView "Performance Counter Classes" " " " " "Raw and calculated performance data from performance counters." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" " " "Formatted performance counter classes." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData" "Abstract base class for the formatted data classes." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_ASP_ActiveServerPages" "Performance counters for the Active Server Pages device on the computer system." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_ContentFilter_IndexingServiceFilter" "Performance information about an Indexing Service filter." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_ContentIndex_IndexingService" "Performance data about the state of the Indexing Service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_InetInfo_InternetInformationServicesGlobal" "Performance counters that monitor Internet Information Services (the web service and the FTP service) as a whole." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_ISAPISearch_HttpIndexingService" "Performance counters that monitor the HTTP Indexing Service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_MSDTC_DistributedTransactionCoordinator" "Performance counters for Microsoft Distributed Transaction Coordinator performance counters." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_NTFSDRV_SMTPNTFSStoreDriver" "Performance counters for the Exchange NTFS Store driver." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfDisk_LogicalDisk" "Performance counters that monitor logical partitions of a hard or fixed disk drive." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfDisk_PhysicalDisk" "Performance counters that monitor hard or fixed disk drives on a computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfNet_Browser" "Performance counters that measure the rates of announcements, enumerations, and other browser transmissions." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfNet_Redirector" "Performance counters that monitor network connections originating at the local computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfNet_Server" "Performance counters that monitor communications using the WINS Server service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfNet_ServerWorkQueues" "Performance counters that monitor the length of the queues and objects in the queues." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfOS_Cache" "Performance counters that monitor the file system cache, an area of physical memory that stores recently used data as long as possible to permit access to the data without having to read from the disk." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfOS_Memory" "Performance counters that describe the behavior of physical and virtual memory on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfOS_Objects" "Performance counter for the objects contained by the operating system such as events, mutexes, processes, sections, semaphores, and threads." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfOS_PagingFile" "Performance counters that monitor the paging file(s) on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfOS_Processor" "Performance counters that measure aspects of processor activity." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfOS_System" "Performance counters that apply to more than one instance of a component processors on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfProc_FullImage_Costly" "Performance counters that monitor the virtual address usage of images executed by processes on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfProc_Image_Costly" "Performance counters that monitor the virtual address usage of images executed by processes on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfProc_JobObject" "Performance counters for the accounting and processor usage data collected by each active named job object." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfProc_JobObjectDetails" "Performance counters for information about the active processes that make up a job object." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfProc_Process" "Performance counters that monitor running application program and system processes." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfProc_ProcessAddressSpace_Costly" "Performance counters that monitor memory allocation and use for a selected process." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfProc_Thread" "Performance counters that measure aspects of thread behavior." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PerfProc_ThreadDetails_Costly" "Performance counters that measure aspects of thread behavior that are difficult or time-consuming to collect." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PSched_PSchedFlow" "Performance counters for flow statistics from the packet scheduler." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_PSched_PSchedPipe" "Performance counters for pipe statistics from the packet scheduler." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_RemoteAccess_RASPort" "Performance counters that monitor individual Remote Access Service ports of the RAS device on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_RemoteAccess_RASTotal" "Performance counters that combine values for all ports of the Remote Access service (RAS) device on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_RSVP_ACSRSVPInterfaces" "Performance counters for the number of local network interfaces visible to, and used by the RSVP service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_RSVP_ACSRSVPService" "Performance counters for RSVP or ACS service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_SMTPSVC_SMTPServer" "Performance counters specific to the SMTP Server." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_Spooler_PrintQueue" "Performance performance counters for a print queue." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_TapiSrv_Telephony" "Represents the telephony system." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_Tcpip_ICMP" "Performance counters that measure the rates at which messages are sent and received by using ICMP protocols." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_Tcpip_IP" "Performance counters that measure the rates at which IP datagrams are sent and received by using IP protocols." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_Tcpip_NBTConnection" "Performance counters that measure the rates at which bytes are sent and received over the NBT connection between the local computer and a remote computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_Tcpip_NetworkInterface" "Performance counters that measure the rates at which bytes and packets are sent and received over a TCP/IP network connection." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_Tcpip_TCP" "Performance counters that measure the rates at which TCP segments are sent and received by using the TCP protocol." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_Tcpip_UDP" "Performance counters that measure the rates at which UDP datagrams are sent and received by using the UDP protocol." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_TermService_TerminalServices" "Performance counters for terminal services summary information." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_TermService_TerminalServicesSession" "Performance counters for terminal services per-session resource monitoring." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Formatted Performance Counter Classes" "Win32_PerfFormattedData_W3SVC_WebService" "Performance counters specific to the World Wide Web Publishing Service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" " " "Raw performance counter classes." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData" "Abstract base class for all concrete raw performance counter classes." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_ASP_ActiveServerPages" "Performance counters for the Active Server Pages device on the computer system." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_ContentFilter_IndexingServiceFilter" "Performance counters for an Indexing Service filter." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_ContentIndex_IndexingService" "Performance counters for the state of the Indexing Service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_InetInfo_InternetInformationServicesGlobal" "Performance counters that monitor Internet Information Services (the web service and the FTP service) as a whole." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_ISAPISearch_HttpIndexingService" "Performance counters for the HTTP Indexing Service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_MSDTC_DistributedTransactionCoordinator" "Performance counters for Microsoft Distributed Transaction Coordinator." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_NTFSDRV_SMTPNTFSStoreDriver" "Performance counters for global counters for the Exchange NTFS Store driver." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfDisk_LogicalDisk" "Performance counters that monitor logical partitions of a hard or fixed disk drive." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfDisk_PhysicalDisk" "Performance counters that monitor hard or fixed disk drives on a computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfNet_Browser" "Performance counters that measure the rates of announcements, enumerations, and other browser transmissions." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfNet_Redirector" "Performance counters that monitor network connections originating at the local computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfNet_Server" "Performance counters that monitor communications using the WINS Server service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfNet_ServerWorkQueues" "Performance counters that monitor the length of the queues and objects in the queues." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfOS_Cache" "Performance counters that monitor the file system cache." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfOS_Memory" "Performance counters that describe the behavior of physical and virtual memory on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfOS_Objects" "Performance counters for objects contained by the operating system such as events, mutexes, processes, sections, semaphores, and threads." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfOS_PagingFile" "Performance counters that monitor the paging file(s) on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfOS_Processor" "Performance counters that measure aspects of processor activity." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfOS_System" "Performance counters that apply to more than one instance of a component processors on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfProc_FullImage_Costly" "Performance counters that monitor the virtual address usage of images executed by processes on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfProc_Image_Costly" "Performance counters that monitor the virtual address usage of images executed by processes on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfProc_JobObject" "Performance counters for the accounting and processor usage data collected by each active, named Job object." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfProc_JobObjectDetails" "Performance counters for the active processes that make up a Job object." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfProc_Process" "Performance counters that monitor running application program and system processes." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfProc_ProcessAddressSpace_Costly" "Performance counters that monitor memory allocation and use for a selected process." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfProc_Thread" "Performance counters that measure aspects of thread behavior." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PerfProc_ThreadDetails_Costly" "Performance counters that measure aspects of thread behavior that are difficult or time-consuming to collect." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PSched_PSchedFlow" "Performance counters for flow statistics from the packet scheduler." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_PSched_PSchedPipe" "Performance counters for pipe statistics from the packet scheduler." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_RemoteAccess_RASPort" "Performance counters that monitor individual Remote Access Service ports of the RAS device on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_RemoteAccess_RASTotal" "Performance counters that combine values for all ports of the Remote Access service (RAS) device on the computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_RSVP_ACSRSVPInterfaces" "Performance counters for local network interfaces visible to, and used by the RSVP service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_RSVP_ACSRSVPService" "Performance counters for RSVP or ACS service." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_SMTPSVC_SMTPServer" "Performance counters specific to the SMTP server." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_Spooler_PrintQueue" "Performance counters for a print queue." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_TapiSrv_Telephony" "Performance counters for the telephony system." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_Tcpip_ICMP" "Performance counters that measure the rates at which messages are sent and received by using ICMP protocols." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_Tcpip_IP" "Performance counters that measure the rates at which IP datagrams are sent and received by using IP protocols." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_Tcpip_NBTConnection" "Performance counters that measure the rates at which bytes are sent and received over the NBT connection between the local computer and a remote computer." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_Tcpip_NetworkInterface" "Performance counters that measure the rates at which bytes and packets are sent and received over a TCP/IP network connection." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_Tcpip_TCP" "Performance counters that measure the rates at which TCP Segments are sent and received by using the TCP protocol." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_Tcpip_UDP" "Performance counters that measure the rates at which UDP datagrams are sent and received by using the UDP protocol." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_TermService_TerminalServices" "Performance counters for terminal services summary information." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_TermService_TerminalServicesSession" "Performance counters for terminal services per-session resource monitoring." + Add-WMITreeNode $TreeView "Performance Counter Classes" "Raw Performance Counter Classes" "Win32_PerfRawData_W3SVC_WebService" "Performance counters specific to the World Wide Web Publishing Service." + Add-WMITreeNode $TreeView "Software-related objects" " " " " "Software-related objects." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" " " "Software-related objects." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ActionCheck" "Relates a Windows Installer action with any locational information it requires." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ApplicationCommandLine" "Identifies a connection between an application and its command-line access point." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ApplicationService" "Represents any installed or advertised components or applications available on the system." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_Binary" "Represents binary information (such as bitmaps, icons, executable files, and so on) that are used by an installation." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_BindImageAction" "Binds each executable file that must be bound to the DLLs imported by it." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_CheckCheck" "Relates an Installer action with any locational information it requires." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ClassInfoAction" "Manages the registration of COM class information with the system." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_CommandLineAccess" "Represents the command line interface to a service or application." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_Condition" "Represents the criteria used to determine the selection state of any entry in the Win32_Feature class." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_CreateFolderAction" "Creates an empty folder for components set to be installed locally." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_DuplicateFileAction" "Creates one or more copies of files installed by the InstallFiles executable action, either to a different directory than the original file, or to the same directory, but with a different name." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_EnvironmentSpecification" "Contains information about any environment variables that must be registered for their associated products installation." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ExtensionInfoAction" "Manages the registration of extension related information with the system." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_FileSpecification" "Represents a source file with its various attributes, ordered by a unique, non-localized identifier." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_FontInfoAction" "Registers installed fonts with the system." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_IniFileSpecification" "Contains the .INI information that the application needs to set in an .ini file." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_InstalledSoftwareElement" "Identifies the computer system on which a particular software element is installed." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_LaunchCondition" "Contains a list of conditions, all of which must be satisfied for the action to succeed." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ManagedSystemElementResource" "Relates an Installer feature with an action used to register and publish the feature." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_MIMEInfoAction" "Registers the MIME-related registry information with the system." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_MoveFileAction" "Locates files that already exist on the user's computer, and move or copy those files to a new location." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_MSIResource" "Represents any resource used by the Installer during the course of an installation or update." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ODBCAttribute" "Represents attributes that are set off an ODBC driver." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ODBCDataSourceAttribute" "Relates an Installer check with any setting information it requires." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ODBCDataSourceSpecification" "Specifies any data source (DSN) that must be registered as part of an installation." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ODBCDriverAttribute" "Relates an Installer check with any setting information it requires." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ODBCDriverSoftwareElement" "Determines the software element of which the ODBC driver is a part." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ODBCDriverSpecification" "Represents any ODBC driver to be installed as part of a particular product." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ODBCSourceAttribute" "Represents attributes set for an ODBC data source." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ODBCTranslatorSpecification" "Represents any ODBC translator that is included as part of a product installation." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_Patch" "Represents an individual update that is to be applied to a particular file and whose source resides at a specified location." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_PatchFile" "Relates an Installer check with any setting information it requires." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_PatchPackage" "Describes an update package that has been applied to this product." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_Product" "Represents a product as it is installed by Windows Installer." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ProductCheck" "Relates instances of CIM_Check and Win32_Product." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ProductResource" "Relates instances of Win32_Product and Win32_MSIResource." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ProductSoftwareFeatures" "Identifies the software features for a particular product." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ProgIDSpecification" "Represents any ProgID that must be registered during a given installation." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_Property" "Contains the property names and values for all defined properties in the installation." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_PublishComponentAction" "Manages the advertisement of the components that may be faulted in by other products with the system." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_RegistryAction" "Configures registry information that the application desires in the system registry." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_RemoveFileAction" "Uninstalls files previously installed by the InstallFiles action." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_RemoveIniAction" "Deletes .ini file information that the application desires to delete." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ReserveCost" "Reserves a specified amount of disk space in any directory, depending on the installation state of a component." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SelfRegModuleAction" "Processes all the modules in the SelfReg module to register the modules, if installed." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ServiceControl" "Represents instructions for controlling both installed and uninstalled services." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ServiceSpecification" "Represents a service to be installed along with an associated package." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ServiceSpecificationService" "Represents instances of Win32_ServiceSpecification and Win32_Service." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SettingCheck" "Relates an Installer check with any setting information it requires." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ShortcutAction" "Manages the creation of shortcuts." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_ShortcutSAP" "Identifies a connection between an application access point and the corresponding shortcut." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareElement" "Represents a software element, part of a software feature." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareElementAction" "Relates an Installer software element with an action that access the element." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareElementCheck" "Relates an Installer element with any condition or locational information that a feature may require." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareElementCondition" "Represents conditional checks that must be evaluated to TRUE before their associated Win32_SoftwareElement instance can be installed." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareElementResource" "Relates a software element with a resource used by that software element." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareFeature" "Represents a distinct subset of a product, consisting of one or more software elements." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareFeatureAction" "Relates an Installer feature with an action used to register and publish the feature." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareFeatureCheck" "Relates an Installer feature with any condition or locational information that a feature may require." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareFeatureParent" "Establishes dependency relationships between objects." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_SoftwareFeatureSoftwareElements" "Identifies the software elements that make up a particular software feature." + Add-WMITreeNode $TreeView "Software-related objects" "Installed Applications Classes" "Win32_TypeLibraryAction" "Registers type libraries with the system." + Add-WMITreeNode $TreeView "WMI Service Management Classes" " " " " "Management for WMI." + Add-WMITreeNode $TreeView "WMI Service Management Classes" "WMI Management Classes" " " "The WMI management classes represent operational parameters for the WMI service." + Add-WMITreeNode $TreeView "WMI Service Management Classes" "WMI Management Classes" "Win32_WMISetting" "Contains the operational parameters for the WMI service." + Add-WMITreeNode $TreeView "WMI Service Management Classes" "WMI Management Classes" "Win32_WMIElementSetting" "Association between a service running in the Windows system, and the WMI settings it can use." + + Add-WMITreeNodesOrderedByName + + Write-Progress -Activity "Added WMIClasses" -Status "Done" -Completed + } + Catch + { + Write-Verbose "Add-WMITreeNodes Catch" + Write-Verbose $_.Exception.Message + } +} +#Adds WMI Category Listitems for a WMI Root +Function Fill-ListViewWMIRoot() +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True)] + [System.Windows.Forms.ListView]$ListView, + [parameter(Mandatory=$True)] + [Object]$NodeWMIRoot + ) + Write-Verbose "Fill-ListViewWMIRoot" + Try + { + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Category") + $Column.Width=$ListView.Width *.40 + $Column=$ListView.Columns.Add("Description") + $Column.Width=$ListView.Width *.59 + ForEach($Node in $NodeWMIRoot.Nodes) + { + + $Item=$ListView.Items.Add($Node.Tag.Category) + $Item.SubItems.Add($Node.Tag.Description) + } + } + Catch [System.Exception] + { + Write-Verbose "Fill-ListViewWMIRoot Catch" + Write-Verbose $_.Exception.Message + } +} +#Adds WMI SubCategory Listitems for a WMI Category +Function Fill-ListViewWMICategory() +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True)] + [System.Windows.Forms.ListView]$ListView, + [parameter(Mandatory=$True)] + [Object]$NodeCategory + ) + Write-Verbose "Fill-ListViewCategory" + Try + { + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("SubCategory") + $Column.Width=$ListView.Width *.40 + $Column=$ListView.Columns.Add("Description") + $Column.Width=$ListView.Width *.59 + ForEach($Node in $NodeCategory.Nodes) + { + + $Item=$ListView.Items.Add($Node.Tag.SubCategory) + $Item.SubItems.Add($Node.Tag.Description) + } + } + Catch [System.Exception] + { + Write-Verbose "Fill-ListViewCategory Catch" + Write-Verbose $_.Exception.Message + } +} +#Adds WMI Class Listitems for a WMI SubCategory +Function Fill-ListViewWMISubCategory() +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True)] + [System.Windows.Forms.ListView]$ListView, + [parameter(Mandatory=$True)] + [Object]$NodeSubCategory + ) + Write-Verbose "Fill-ListViewSubCategory" + Try + { + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Class") + $Column.Width=$ListView.Width *.40 + $Column=$ListView.Columns.Add("Description") + $Column.Width=$ListView.Width *.59 + ForEach($Node in $NodeSubCategory.Nodes) + { + + $Item=$ListView.Items.Add($Node.Tag.Class) + $Item.SubItems.Add($Node.Tag.Description) + } + } + Catch [System.Exception] + { + Write-Verbose $_.Exception.Message + } +} +#Adds a WMI Object Listitem for a WMI Class +Function Fill-ListViewWMIClass() +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True)] + [System.Windows.Forms.ListView]$ListView, + [parameter(Mandatory=$True)] + [object]$NodeClass, + [parameter(Mandatory=$True)] + [int]$Count, + [parameter(Mandatory=$True)] + [string]$Name + ) + Write-Verbose "Fill-ListViewWMIClass" + Try + { + $Item=$ListView.Items.Add($Node.Tag.Class+"["+$Count+"]") + $Item.SubItems.Add($Name) + } + Catch [System.Exception] + { + Write-Verbose "Fill-ListViewWMIClass Catch" + Write-Verbose $_.Exception.Message + } +} +#Process A WMIObject Instance +Function Process-WMIObjectInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [Object]$Node + ) + Write-Verbose "Process-WMIObjectInstance" + $NodeType=Get-WMIObjectType $Node.Tag + If ($NodeType -EQ "WMIRoot") + { + Write-Verbose "Process-WMIObjectInstance WMIRoot" + Fill-ListViewWMIRoot $ListView $Node + Fill-ListViewClass $ListViewClass $Node.Tag + $TextBoxPSObject.Text = "" + $StatusBar.Text = $Node.Tag.Description + } + ElseIf ($NodeType -EQ "WMICategory") + { + Write-Verbose "Process-WMIObjectInstance WMICategory" + Fill-ListViewWMICategory $ListView $Node + Fill-ListViewClass $ListViewClass $Node.Tag + $TextBoxPSObject.Text = "" + $StatusBar.Text = $Node.Tag.Description + } + ElseIf ($NodeType -EQ "WMISubCategory") + { + Write-Verbose "Process-WMIObjectInstance WMISubCategory" + Fill-ListViewWMISubCategory $ListView $Node + Fill-ListViewClass $ListViewClass $Node.Tag + $TextBoxPSObject.Text = "" + $StatusBar.Text = $Node.Tag.Description + } + ElseIf ($NodeType -EQ "WMIClass") + { + Write-Verbose "Process-WMIObjectInstance WMIClass" + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Instance") + $Column.Width=$ListView.Width *.45 + $Column=$ListView.Columns.Add("Value") + $Column.Width=$ListView.Width *.54 + $Node.Nodes.Clear() + $StatusBar.Text = "Retrieving "+ $Node.Tag.Class +" classes" + $Objects = Get-WmiObject -Class $Sender.SelectedNode.Text -Computer $TextBoxComputers.Text -Filter $TextBoxFilter.Text + $Key="" + $Count=0 + ForEach($Object in $Objects) + { + $StatusBar.Text = "Retrieving "+ $Node.Tag.Class +"[" + $Count +"]" + $Name = Get-InstanceFriendlyName $Object + $NewNode=$Node.Nodes.Add((Get-NextKey)+" "+$Name,$Name) + $NewNode.Tag = $Object + Fill-ListViewWMIClass $ListView $Node $Count $Name + $Count++ + } + Fill-ListViewClass $ListViewClass $Node.Tag + $TextBoxPSObject.Text = "" + $StatusBar.Text = $Node.Tag.Description + } +} + +#endregion +#region Net Assemblies + +#Adds Net Assemblies +Function Add-NetAssemblies +{ + [CmdletBinding()] + param() + Try + { + Write-Verbose "Add-NetAssemblies" + $NetAssemblies=New-Object System.Collections.SortedList + $Assemblies = [appdomain]::CurrentDomain.GetAssemblies() + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Assemblies.Count + ForEach ($Assembly in $Assemblies) + { + $AssemblyName=$($Assembly.FullName).Split(",")[0] + Write-Progress -Activity "Adding Assembly $AssemblyName" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + IF ($NetAssemblies[$AssemblyName] -EQ $Null) + { + $NetAssemblies.Add($AssemblyName,$Assembly) + } + } + Write-Progress -Activity "Added PS Assemblies" -Status "Done" -Completed + $NetAssemblies + } + Catch [System.Exception] + { + Write-Verbose "Add-NetAssemblies Catch" + Write-Verbose $_.Exception.Message + } +} + +#Adds Net Assemblies node +Function Add-NetAssembliesNode +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True,Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-NetAssembliesNode" + $NetAssemblies = Add-NetAssemblies + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +".Net Assemblies"),".Net Assemblies") + $Node.Tag = $NetAssemblies + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-NetAssembliesNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region Net Classes +#Adds Net Assemblies For Net Classes +Function Add-NetClassAssemblies +{ + [CmdletBinding()] + param() + Try + { + Write-Verbose "Add-NetClassAssemblies" + If ($Script:POETreeNodes["NetAsssembliesList"] -NE $Null) + { + } + Else + { + $NetAssemblies=@{} + $NetAssemblyMaxClasses=0 + $NetAssemblyClasses=0 + $Assemblies = [appdomain]::CurrentDomain.GetAssemblies() + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Assemblies.Count + ForEach ($Assembly in $Assemblies) + { + $AssemblyName=$Assembly.FullName.Split(",")[0] + Write-Progress -Activity "Adding Assembly $AssemblyName" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + IF ($NetAssemblies[$AssemblyName] -EQ $Null) + { + $NetAssemblies.Add($AssemblyName,$Assembly) + $AssemblyClasses=$Assembly.ExportedTypes + $AssemblyClassesCount = $AssemblyClasses.Count + } + Else + { + $AssemblyClassesCount=0 + } + IF ($AssemblyClassesCount -GT $NetAssemblyMaxClasses) + { + $NetAssemblyMaxClasses = $AssemblyClassesCount + } + $NetAssemblyClasses += $AssemblyClassesCount + } + Write-Progress -Activity "Added PS Assemblies" -Status "Done" -Completed + $Script:POETreeNodes.Add("NetAssemblyMaxClasses",$NetAssemblyMaxClasses) + $Script:POETreeNodes.Add("NetAssemblyClasses",$NetAssemblyClasses) + $NetAssemblies + } + } + Catch [System.Exception] + { + Write-Verbose "Add-NetClassAssemblies Catch" + Write-Verbose $_.Exception.Message + } +} + +#Adds Net Classes +Function Add-NetClasses +{ + [CmdletBinding()] + param( + [Object]$ClassList, + [String]$ClassName, + [Object]$Class + ) + Try + { + $Position = $ClassName.IndexOf(".") + IF ($Position -GT 0) + { + $ClassFirst = $ClassName.Substring(0,$Position) + If ($ClassList.Count -GT 0) + { + $NewClassList = $ClassList[$ClassFirst] + If ($NewClassList -EQ $Null) + { + $NewClassList = New-Object System.Collections.SortedList + $ClassList.Add($ClassFirst,$NewClassList) + } + } + Else + { + $NewClassList = New-Object System.Collections.SortedList + IF ($ClassList -EQ $Null) + { + } + Else + { + $ClassList.Add($ClassFirst,$NewClassList) + } + } + $ClassRest = $ClassName.Substring($Position+1) + Add-NetClasses $NewClassList $ClassRest $Class + } + Else + { + If ($ClassList[$ClassName] -EQ $Null) + { + $ClassList.Add($Class.FullName,$Class) + } + } + } + Catch [System.Exception] + { + Write-Verbose "Add-NetClasses Catch" + Write-Verbose $_.Exception.Message + } +} +Function Add-SomeNetClasses +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True,Position=0)] + [Int]$Index + ) + Try + { + Write-Verbose "Add-SomeNetClasses Index=$Index" + $NetClasses=$Script:POETreeNodes["NetClassesList"] + $NetAssembliesToProcess=$Script:POETreeNodes["NetAssembliesToProcess"] + $NetClassesProcessed=$Script:POETreeNodes["NetClassesProcessed"] + $KeysToProcess=$NetAssembliesToProcess.Keys + $Keys=@() + ForEach($Key in $KeysToProcess) + { + $Keys += $Key + } + For ($I=0; $I -LT $Keys.Count;$I++) + { + $Key=$Keys[$I] + $Assembly=$NetAssembliesToProcess[$Key] + $Classes=$Assembly.ExportedTypes + $Count=$Classes.Count + If($Index -LT $Count) + { + $Class = $Classes[$Index] + $NetClassesProcessed++ + IF($Class.IsPublic) + { + $FullName = $Class.FullName + IF (($FullName.Contains("_")) -OR + ($FullName.Contains("XamlGeneratedNamespace")) + ) + { + } + Else + { + IF ($FullName.Contains("``")) + { + IF ($FullName.Contains("Collections")) + { + Add-NetClasses $NetClasses $FullName $Class + } + } + Else + { + Add-NetClasses $NetClasses $FullName $Class + } + } + } + } + Else + { + $NetAssembliesToProcess.Remove($Key) + } + } + $Script:POETreeNodes["NetClassesProcessed"]=$NetClassesProcessed + } + Catch + { + Write-Verbose "Add-SomeNetClasses Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add adding Net Classes node +Function Add-NetClassesNode +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True,Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-NetClassesNode" + $NetClassesNode = $Script:POETreeNodes["NetClasses"] + IF ($NetClassesNode -EQ $Null) + { + $NetClasses=New-Object System.Collections.SortedList + $NetAssembliesToProcess = Add-NetClassAssemblies + $NetClassIndex=[int]0 + $NetClassesProcessed=[int]0 + $Script:POETreeNodes.Add("NetClassesList",$NetClasses) + $Script:POETreeNodes.Add("NetClassIndex",$NetClassIndex) + $Script:POETreeNodes.Add("NetAssembliesToProcess",$NetAssembliesToProcess) + $Script:POETreeNodes.Add("NetClassesProcessed",$NetClassesProcessed) + } + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + $NetClassesNode = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +".Net Classes"),".Net Classes") + $NetClassesNode.Tag = $NetClasses + $NetClassesNode.EnsureVisible() + $NetClassesNode + } + Catch [System.Exception] + { + Write-Verbose "Add-NetClassesNodes Catch" + Write-Verbose $_.Exception.Message + } +} +#endregion +#region PS Aliases + +#Adds a PS Alias +Function Add-PSAlias +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$Alias, + [parameter(Mandatory=$True, + Position=1)] + [Object]$PSAliasesByAlias, + [parameter(Mandatory=$True, + Position=2)] + [Object]$PSAliasesByCommand + ) + TRY + { + Write-Verbose "Add-PSAlias Alias.Name=$($Alias.Name)" + If ($Alias) #Not Null + { + $AliasName = $Alias.Name + $Space = $AliasName.PadRight(25-$AliasName.Length) + $Definition = $Alias.Definition + $Name = $Space+$Definition + $PSAliasesByAlias.Add($Name,$Alias) + + $AliasName = $Alias.Name + $Definition = $Alias.Definition + $Space = $Definition.PadRight(50-$Definition.Length) + $Name = $Space+$AliasName + $PSAliasesByCommand.Add($Name,$Alias) + } + + } + Catch [System.Exception] + { + Write-Verbose "Add-PSAlias Catch" + Write-Verbose $_.Exception.Message + } +} + +#Adds PS Aliases +Function Add-PSAliases +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "Add-PSAliases" + $PSAliases=[ordered]@{} + $PSAliasesByAlias=New-Object System.Collections.SortedList + $PSAliasesByCommand=New-Object System.Collections.SortedList + $Aliases = Get-Alias + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Aliases.Count + For($I=0;$I -LT $Aliases.Count;$I++) + { + $Alias=$Aliases[$I] + Write-Progress -Activity "Adding Alias $Alias" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + $AliasNode = Add-PSAlias $Alias $PSAliasesByAlias $PSAliasesByCommand + } + Write-Progress -Activity "Added PS Aliases" -Status "Done" -Completed + $PSAliases.Add("By Alias",$PSAliasesByAlias) + $PSAliases.Add("By Command",$PSAliasesByCommand) + $PSAliases + } + Catch [System.Exception] + { + Write-Verbose "Add-PSAliases Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView node for PS Aliases +Function Add-PSAliasesNode +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True,Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-PSAliasesNode" + $PSAliases = Add-PSAliases + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"PowerShell Aliases"),"PowerShell Aliases") + $Node.Tag = $PSAliases + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-PSAliasesNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region PS Commands + +#Adds a PS Command +Function Add-PSCommand +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$PSCommand, + [parameter(Mandatory=$True, + Position=1)] + [Object]$PSCommandsByName, + [parameter(Mandatory=$True, + Position=2)] + [Object]$PSCommandsByModule, + [parameter(Mandatory=$True, + Position=3)] + [Object]$PSCommandsByApprovedVerb, + [parameter(Mandatory=$True, + Position=4)] + [Object]$PSCommandsByNonApprovedVerb + ) + TRY + { + Write-Verbose "Add-PSCommand PSCommand.Name=$($PSCommand.Name)" + If ($PSCommand -NE $Null) + { + $CommandName = $PSCommand.Name + $PSCommandsByName.Add($CommandName,$Command) + + $ModuleName = $Command.Module.Name + IF ($ModuleName -NE $Null) + { + $Module = $PSCommandsByModule[$ModuleName] + If ($Module -EQ $Null) + { + $Module=New-Object System.Collections.SortedList + $PSCommandsByModule.Add($ModuleName,$Module) + } + $Module.Add($CommandName,$Command) + } + $VerbName = $PSCommand.Verb + IF ($VerbName -NE "") + { + $Verb = $PSCommandsByApprovedVerb[$VerbName] + If ($Verb -EQ $Null) + { + $Verb = $PSCommandsByNonApprovedVerb[$VerbName] + IF($Verb -EQ $Null) + { + $Verb=New-Object System.Collections.SortedList + $PSCommandsByNonApprovedVerb.Add($VerbName,$Verb) + } + } + } + Else + { + If ($CommandName.Contains(":")) + { + $VerbName = " Drive Alias" + } + ElseIf ($CommandName.Contains("_")) + { + $VerbName = " Event Handler" + } + ElseIf ($CommandName.Contains("-")) + { + $VerbName = $CommandName.Split("-")[0] + } + Else + { + $VerbName = " Alias" + } + $Verb = $PSCommandsByNonApprovedVerb[$VerbName] + IF($Verb -EQ $Null) + { + $Verb=New-Object System.Collections.SortedList + $PSCommandsByNonApprovedVerb.Add($VerbName,$Verb) + } + } + $Verb.Add($CommandName,$PSCommand) + } + } + Catch [System.Exception] + { + Write-Verbose "Add-PSCommand Catch" + Write-Verbose $_.Exception.Message + } +} + +#Adds PS Commands +Function Add-PSCommands +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "Add-PSCommands" + $PSCommands=[ordered]@{} + $PSCommandsByModule=New-Object System.Collections.SortedList + $PSCommandsByName=New-Object System.Collections.SortedList + $PSCommandsByApprovedVerb=New-Object System.Collections.SortedList + $PSCommandsByNonApprovedVerb=New-Object System.Collections.SortedList + $Commands = Get-Command + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Commands.Count + $PSVerbs = Get-Verb + Write-Verbose "Add-PSCommands Getting Approved Verbs" + ForEach ($PSVerb IN $PSVerbs) + { + $PSCommandsByApprovedVerb.Add($PSVerb.Verb,(New-Object System.Collections.SortedList)) + } + For($I=0;$I -LT $Commands.Count;$I++) + { + $Command=$Commands[$I] + Write-Progress -Activity "Adding Command $Command" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + $CommandNode = Add-PSCommand $Command $PSCommandsByName $PSCommandsByModule $PSCommandsByApprovedVerb $PSCommandsByNonApprovedVerb + } + Write-Progress -Activity "Added PS Commands" -Status "Done" -Completed + $PSCommands.Add("By Name",$PSCommandsByName) + $PSCommands.Add("By Module",$PSCommandsByModule) + $PSCommands.Add("By Approved Verb",$PSCommandsByApprovedVerb) + $PSCommands.Add("By Non Approved Verb",$PSCommandsByNonApprovedVerb) + $PSCommands + } + Catch [System.Exception] + { + Write-Verbose "Add-PSCommands Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView node for PS Commands +Function Add-PSCommandsNode +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True,Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-PSCommandsNode" + IF ($Script:PSCommands) + { + } + Else + { + $PSCommands = Add-PSCommands + } + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + IF ($mnuPSAliases.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"PowerShell Commands"),"PowerShell Commands") + $Node.Tag = $PSCommands + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-PSCommandsNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region PS Drives + +#Adds a PS Drive +Function Add-PSDrive +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$PSDrive, + [parameter(Mandatory=$True, + Position=1)] + [Object]$PSDrivesByName, + [parameter(Mandatory=$True, + Position=2)] + [Object]$PSDrivesByProvider + ) + TRY + { + Write-Verbose "Add-PSDrive PSDrive.Name=$($PSDrive.Name)" + If ($PSDrive -NE $Null) + { + $DriveName = $Drive.Name + $PSDrivesByName.Add($DriveName,$PSDrive) + + $ProviderName = $PSDrive.Provider.Name + $Provider = $PSDrivesByProvider[$ProviderName] + If ($Provider -NE $NULL) + { + } + Else + { + $Provider=New-Object System.Collections.SortedList + $PSDrivesByProvider.Add($ProviderName,$Provider) + } + $Provider.Add($DriveName,$Drive) + } + } + Catch [System.Exception] + { + Write-Verbose "Add-PSDrive Catch" + Write-Verbose $_.Exception.Message + } +} + +#Adds PS Drives +Function Add-PSDrives +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "Add-PSDrives" + $PSDrives=[ordered]@{} + $PSDrivesByProvider=New-Object System.Collections.SortedList + $PSDrivesByName=New-Object System.Collections.SortedList + $Drives = Get-PSDrive + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Drives.Count + For($I=0;$I -LT $Drives.Count;$I++) + { + $Drive=$Drives[$I] + Write-Progress -Activity "Adding Drive $Drive" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + Add-PSDrive $Drive $PSDrivesByName $PSDrivesByProvider + } + Write-Progress -Activity "Added PS Drives" -Status "Done" -Completed + $PSDrives.Add("By Name",$PSDrivesByName) + $PSDrives.Add("By Provider",$PSDrivesByProvider) + $PSDrives + } + Catch [System.Exception] + { + Write-Verbose "Add-PSDrives Catch" + Write-Verbose $_.Exception.Message + } +} +#Add TreeView node for PS Drives + +Function Add-PSDrivesNode +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True,Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-PSDrivesNode" + $PSDrives = Add-PSDrives + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + IF ($mnuPSAliases.Checked) {$Index++} + IF ($mnuPSCommands.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"PowerShell Drives"),"PowerShell Drives") + $Node.Tag = $PSDrives + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-PSDrivesNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region PS Modules + +#Adds loaded PS Modules +Function Add-PSModules +{ + [CmdletBinding()] + param() + Try + { + Write-Verbose "Add-PSModules" + $PSModules=[ordered]@{} + $Modules=Get-Module + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Modules.Count + ForEach ($Module In $Modules) + { + Write-Progress -Activity "Adding Module $Module" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + IF (! $PSModules[$Module.Name]) + { + $PSModules.Add($Module.Name,$Module) + } + } + Write-Progress -Activity "Added PS Modules" -Status "Done" -Completed + $PSModules + } + Catch [System.Exception] + { + Write-Verbose "Add-PSModules Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView node for PS Variables +Function Add-PSModulesNode +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True,Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-PSModulesNode" + $PSModules = Add-PSModules + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + IF ($mnuPSAliases.Checked) {$Index++} + IF ($mnuPSCommands.Checked) {$Index++} + IF ($mnuPSDrives.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"PowerShell Modules"),"PowerShell Modules") + $Node.Tag = $PSModules + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-PSModulesNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region PS Variables + +#Add PS Variable +Function Add-PSVariable +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [Object]$Variable, + [parameter(Mandatory=$True, + Position=1)] + [Object]$PSVariablesAuto, + [parameter(Mandatory=$True, + Position=2)] + [Object]$PSVariablesConfig, + [parameter(Mandatory=$True, + Position=3)] + [Object]$PSVariablesForm, + [parameter(Mandatory=$True, + Position=4)] + [Object]$PSVariablesScript, + [parameter(Mandatory=$True, + Position=5)] + [Object]$PSVariablesLocal + ) + Write-Debug "Add-PSVariable Variable.Name=$($Variable.Name)" + TRY + { + If ($Variable -NE $Null) #Not Null + { + If ($IsPSAutoVariable[$Variable.Name]) + { + $PSVariablesAuto.Add($Variable.Name,$Variable) + Write-Debug "PSVariablesAuto.Count=$($PSSAutoVariables.Count)" + } + ElseIf ($IsPSConfigVariable[$Variable.Name]) + { + $PSVariablesConfig.Add($Variable.Name,$Variable) + Write-Debug "PSVariablesConfig.Count=$($PSVariablesConfig.Count)" + } + ElseIf ($IsPSFormVariable[$Variable.Name]) + { + $PSVariablesForm.Add($Variable.Name,$Variable) + Write-Debug "PSVariablesForm.Count=$($PSVariablesForm.Count)" + } + ElseIf ($IsPSScriptVariable[$Variable.Name]) + { + $PSVariablesScript.Add($Variable.Name,$Variable) + Write-Debug "PSVariablesScript.Count=$($PSVariablesScript.Count)" + } + Else + { + IF (($Variable.Value -Is [System.Windows.Forms.TreeView]) -And + ($Variable.Value.Name -EQ "TreeViewInstance") + ) + { + } + Else + { + $PSVariablesLocal.Add($Variable.Name,$Variable) + Write-Debug "PSVariablesLocal.Count=$($PSVariablesLocal.Count)" + } + } + } + } + Catch [System.Exception] + { + Write-Verbose "Add-PSVariable Catch" + Write-Verbose $_.Exception.Message + } +} + +#Adds PS Variables +Function Add-PSVariables +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "Add-PSVariables" + $Variables = Get-Variable + Write-Verbose "Variables.GetType=$($Variables.GetType())" + Write-Verbose "Variables.Count=$($Variables.Count)" + $PSVariables=[ordered]@{} + $PSVariablesAuto=[ordered]@{} + $PSVariablesConfig=[ordered]@{} + $PSVariablesForm=[ordered]@{} + $PSVariablesScript=[ordered]@{} + $PSVariablesLocal=[ordered]@{} + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Variables.Count + ForEach ($Variable In $Variables) + { + Write-Progress -Activity "Adding Variable $Variable" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + Add-PSVariable $Variable $PSVariablesAuto $PSVariablesConfig $PSVariablesForm $PSVariablesScript $PSVariablesLocal + } + Write-Progress -Activity "Added PS Variables" -Status "Done" -Completed + $PSVariables.Add("PowerShell Automatic Variables",$PSVariablesAuto) + $PSVariables.Add("PowerShell Preference Variables",$PSVariablesConfig) + $PSVariables.Add("Form Variables",$PSVariablesForm) + $PSVariables.Add("Script Variables",$PSVariablesScript) + $PSVariables.Add("User Defined Variables",$PSVariablesLocal) + $PSVariables + } + Catch [System.Exception] + { + Write-Verbose "Add-PSVariables Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView node for PS Variables +Function Add-PSVariablesNode +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-PSVariablesNode" + $PSVariables = Add-PSVariables + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + IF ($mnuPSAliases.Checked) {$Index++} + IF ($mnuPSCommands.Checked) {$Index++} + IF ($mnuPSDrives.Checked) {$Index++} + IF ($mnuPSModules.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"PowerShell Variables"),"PowerShell Variables") + $Node.Tag = $PSVariables + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-PSVariablesNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region WIN Features + +#Adds Windows Features +Function Add-WINFeatures +{ + [CmdletBinding()] + param ( + ) + Try + { + Write-Verbose "Add-WINFeatures" + $WINFeatureInstalled=New-Object System.Collections.SortedList + $WINFeatureNotInstalled=New-Object System.Collections.SortedList + $WINFeatureAll=New-Object System.Collections.SortedList + $WINFeatures=[ordered]@{} + $Features = Get-WindowsFeature -Verbose:$False + Write-Verbose "Features.GetType=$($Features.GetType())" + Write-Verbose "Features.Count=$($Features.Count)" + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Features.Count + ForEach ($Feature In $Features) + { + Write-Progress -Activity "Adding Windows Feature $Feature" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + IF ($Feature.Installed) + { + $WINFeatureInstalled.Add($Feature.Name,$Feature) + } + Else + { + $WINFeatureNotInstalled.Add($Feature.Name,$Feature) + } + $WINFeatureAll.Add($Feature.Name,$Feature) + } + Write-Progress -Activity "Added Windows Features" -Status "Done" -Completed + $WINFeatures.Add("Installed",$WINFeatureInstalled) + $WINFeatures.Add("Not Installed",$WINFeatureNotInstalled) + $WINFeatures.Add("Sorted By Name",$WINFeatureAll) + $WINFeatures + } + Catch [System.Exception] + { + Write-Verbose "Add-WINFeatures Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView node for Windows Features +Function Add-WINFeaturesNode +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-WINFeaturesNode" + $WINFeatures = Add-WINFeatures + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + IF ($mnuPSAliases.Checked) {$Index++} + IF ($mnuPSCommands.Checked) {$Index++} + IF ($mnuPSDrives.Checked) {$Index++} + IF ($mnuPSModules.Checked) {$Index++} + IF ($mnuPSVariables.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"Windows Features"),"Windows Features") + $Node.Tag = $WINFeatures + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-WINFeaturesNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region WIN Processes + +#Adds Windows Processes +Function Add-WINProcesses +{ + [CmdletBinding()] + param ( + ) + Try + { + Write-Verbose "Add-WINProcesses" + $Processes = Get-Process + $WINProcesses=[Ordered]@{} + $WINProcessesID=New-Object System.Collections.SortedList + $WINProcessesName=$Processes + $WINProcessesWindow=New-Object System.Collections.SortedList + $WINProcessesNonWindow=New-Object System.Collections.SortedList + Write-Verbose "Processes.GetType=$($Processes.GetType())" + Write-Verbose "Processes.Count=$($Processes.Count)" + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Processes.Count + ForEach ($Process In $Processes) + { + Write-Progress -Activity "Adding Windows Process $Process" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + $WINProcessesID.Add($Process.ID,$Process) + IF($Process.MainWindowTitle -EQ "") + { + $WINProcessesNonWindow.Add("$($Process.Name) ($($Process.ID))",$Process) + } + Else + { + $WINProcessesWindow.Add("$($Process.Name) ($($Process.ID))",$Process) + } + } + Write-Progress -Activity "Added Windows Processes" -Status "Done" -Completed + $WINProcesses.Add("By ID",$WINProcessesID) + $WINProcesses.Add("By Name",$WINProcessesName) + $WINProcesses.Add("Applications",$WINProcessesWindow) + $WINProcesses.Add("Background Processes",$WINProcessesNonWindow) + $WINProcesses + } + Catch [System.Exception] + { + Write-Verbose "Add-WINProcesss Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView node for Windows Processs +Function Add-WINProcessesNode +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-WINProcessesNode" + $WINProcesses = Add-WINProcesses + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + IF ($mnuPSAliases.Checked) {$Index++} + IF ($mnuPSCommands.Checked) {$Index++} + IF ($mnuPSDrives.Checked) {$Index++} + IF ($mnuPSModules.Checked) {$Index++} + IF ($mnuPSVariables.Checked) {$Index++} + IF ($mnuWINFeature.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"Windows Processes"),"Windows Processes") + $Node.Tag = $WINProcesses + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-WINProcessesNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region WIN Services + +#Adds Windows Services +Function Add-WINServices +{ + [CmdletBinding()] + param ( + ) + Try + { + Write-Verbose "Add-WINServices" + $WINServiceRunning=New-Object System.Collections.SortedList + $WINServiceNotRunning=New-Object System.Collections.SortedList + $WINServiceAll=New-Object System.Collections.SortedList + $WINServices=[ordered]@{} + $Services = Get-Service + Write-Verbose "Services.GetType=$($Services.GetType())" + Write-Verbose "Services.Count=$($Services.Count)" + $ProgressCounter = 0 + $ProgressIncrement = 100 / $Services.Count + ForEach ($Service In $Services) + { + Write-Progress -Activity "Adding Windows Service $Service" -PercentComplete $ProgressCounter -Status "Working ..." + $ProgressCounter += $ProgressIncrement + IF ($Service.Status.ToString() -EQ "Running") + { + $WINServiceRunning.Add($Service.Name,$Service) + } + Else + { + $WINServiceNotRunning.Add($Service.Name,$Service) + } + $WINServiceAll.Add($Service.Name,$Service) + } + Write-Progress -Activity "Added Windows Services" -Status "Done" -Completed + $WINServices.Add("Running",$WINServiceRunning) + $WINServices.Add("Not Running",$WINServiceNotRunning) + $WINServices.Add("Sorted By Name",$WINServiceAll) + $WINServices + } + Catch [System.Exception] + { + Write-Verbose "Add-WINServices Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView node for Windows Services +Function Add-WINServicesNode +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-WINServicesNode" + $WINServices = Add-WINServices + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + IF ($mnuPSAliases.Checked) {$Index++} + IF ($mnuPSCommands.Checked) {$Index++} + IF ($mnuPSDrives.Checked) {$Index++} + IF ($mnuPSModules.Checked) {$Index++} + IF ($mnuPSVariables.Checked) {$Index++} + IF ($mnuWINFeature.Checked) {$Index++} + IF ($mnuWINProcess.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"Windows Services"),"Windows Services") + $Node.Tag = $WINServices + $Node.EnsureVisible() + $Node + } + Catch [System.Exception] + { + Write-Verbose "Add-WINServicesNode Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion +#region "Test Cases" + +#Add TreeView nodes for Test Cases +Function Add-TestCaseLeaf +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True, + Position=0)] + [Object]$Root, + [parameter(Mandatory=$True, + Position=1)] + [String]$Key, + [parameter(Mandatory=$True, + Position=2)] + [Object]$Value + ) + Try + { + Write-Debug "Add-TestCaseLeaf $Key" + $Leaf = $Root[$Key] + If (! $Leaf) + { + $Root.Add($Key,$Value) + } + } + Catch + { + Write-Verbose "Add-TestCaseLeaf Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView nodes for Test Cases +Function Add-TestCaseBranch +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True, + Position=0)] + [Object]$Root, + [parameter(Mandatory=$True, + Position=1)] + [String]$Key + ) + Try + { + Write-Debug "Add-TestCaseBranch $Key" + $Branch = $Root[$Key] + If (! $Branch) + { + $Branch = [ordered]@{} + $Root.Add($Key,$Branch) + } + Else + { + } + $Branch + } + Catch + { + Write-Verbose "Add-TestCaseBranch Catch" + Write-Verbose $_.Exception.Message + } +} +#Adds PSCustomObject Test Cases +Function Add-PSCustomObjectTestCase +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True, + Position=0)] + [Object]$Root, + [parameter(Mandatory=$True, + Position=1)] + [Object]$Key, + [parameter(Mandatory=$True, + Position=2)] + [Object]$Value, + [parameter(Mandatory=$True, + Position=3)] + [Object]$Type + ) + Try + { + Write-Verbose "Add-PSCustomObjectTestCase Key=$Key" + [string]$PSObjectProperty=$Key + $PSObjectProperty=$PSObjectProperty.Replace("[","") + $PSObjectProperty=$PSObjectProperty.Replace("]","_") + $PSObjectProperty=$PSObjectProperty.Replace("(","") + $PSObjectProperty=$PSObjectProperty.Replace(")","") + $PSObjectProperty=$PSObjectProperty.Replace(":","") + $PSObjectProperty=$PSObjectProperty.Replace("$","") + $PSObjectProperty=$PSObjectProperty.Replace("-","") + $PSObjectProperty=$PSObjectProperty.Replace("""","") + $PSObjectProperty=$PSObjectProperty.Replace("'","") + $PSObjectProperty=$PSObjectProperty.Replace(" ","") + $PSObjectProperty=$PSObjectProperty.Replace(".","_") + Write-Verbose "Add-PSCustomObjectTestCase PSObjectProperty=$PSObjectProperty" + + $Level1=Add-TestCaseBranch $Root "PSCustomObject" + $Level2=Add-TestCaseBranch $Level1 "[PSCustomObject] Test Cases" + + $PSObjectKey="PSCustomObject Object" + $PSObject = $Level2[$PSObjectKey] + If ($PSObject -EQ $Null) + { + Write-Verbose "Add-PSCustomObjectTestCase Adding PSCustomObject Object" + $PSObject = New-Object PSObject -Property ([ordered]@{$PSObjectProperty=$Value;}) + $PSObjectLeaf=Add-TestCaseLeaf $Level2 $PSObjectKey $PSObject + $PSObjectType=$PSObject.GetType() + Write-Verbose "Add-PSCustomObjectTestCase Adding [PSObject]" + $PSObjectTypeLeaf=Add-TestCaseLeaf $Level1 "[$($PSObjectType.FullName)]" $PSObjectType + Write-Verbose "Add-PSCustomObjectTestCase Adding PSObject.BaseType" + $BaseLeaf =Add-BaseTypeTestCase $Root $PSObjectType.BaseType $Level2 + $ArrayBranch=Add-TestCaseBranch $Level1 "$($PSObjectType.FullName)[]" + [PSCustomObject[]]$PSObjectArray=@($PSObject) + $ArrayLeaf=Add-TestCaseLeaf $ArrayBranch ($PSObjectType.FullName+"[]Test Case") $PSObjectArray + $ArrayType=$PSObjectArray.GetType() + $ArrayTypeLeaf=Add-TestCaseLeaf $ArrayBranch "[$($ArrayType.FullName)]" $ArrayType + } + Else + { + Add-Member -InputObject $PSObject -MemberType NoteProperty -Name $PSObjectProperty -Value $Value + } + + $PSCustomObjectKey="PSCustomObject "+$($Type.Name) + $PSCustomObject = $Level2[$PSCustomObjectKey] + If ($PSCustomObject -EQ $Null) + { + $PSCustomObject = New-Object PSObject -Property ([ordered]@{$PSObjectProperty=$Value;}) + $PSObjectLeaf=Add-TestCaseLeaf $Level2 $PSCustomObjectKey $PSCustomObject + $PSObjectType=$PSObject.GetType() + $ArrayBranch=Add-TestCaseBranch $Level1 "$($PSObjectType.FullName)[]" + [PSCustomObject[]]$PSObjectArray=@($PSCustomObject) + $OldArray=$ArrayBranch[$PSObjectType.FullName+"[]Test Case"] + $NewArray=$OldArray + $PSObjectArray + $ArrayBranch[$PSObjectType.FullName+"[]Test Case"] = $NewArray + } + Else + { + Add-Member -InputObject $PSCustomObject -MemberType NoteProperty -Name $PSObjectProperty -Value $Value + } + } + Catch + { + Write-Verbose "Add-PSCustomObjectTestCase Catch" + Write-Verbose $_.Exception.Message + } +} +#Adds Array Test Case +Function Add-ArrayTestCase +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True, + Position=0)] + [Object]$Root, + [parameter(Mandatory=$True, + Position=1)] + [String]$Type, + [parameter(Mandatory=$True, + Position=2)] + [Object]$Value + ) + Try + { + Write-Verbose "Add-ArrayTestCase $Type" + $String = "`n" + $String += "[$Type]"+"$"+"Element="+"$"+"Value`n" + $String += "[$Type[]]"+"$"+"NewArray=@("+"$"+"Element)" + Write-Debug "Add-ArrayTestCase String=$String" + Invoke-Expression $String + $GetType=$NewArray.GetType() + $Level1=Add-TestCaseBranch $Root $GetType.BaseType.Name + $Level2=Add-TestCaseBranch $Level1 $GetType.FullName + $ArrayKey="[$($GetType.Name)]Test Case" + $String = "`n" + $String += "[$Type[]]"+"$"+"Array="+"$"+"Level2["+"$"+"ArrayKey]" + Write-Debug "Add-ArrayTestCase String=$String" + Invoke-Expression $String + IF ($Array.Count -GT 0) + { + $String = "`n" + $String += "[$Type[]]"+"$" + "AddArray="+"$"+"Array+"+"$"+"NewArray" + Write-Debug "Add-ArrayTestCase String=$String" + Invoke-Expression $String + $Level2[$ArrayKey]=$AddArray + } + Else + { + $Level2.Add($ArrayKey, $NewArray) + } + $TypeLeaf =Add-TestCaseLeaf $Level2 "[$($GetType.FullName)]" $GetType + $BaseType =Add-BaseTypeTestCase $Root $GetType.BaseType $Level1 + $Level2 + } + Catch + { + Write-Verbose "Add-ArrayTestCase Catch" + Write-Verbose $_.Exception.Message + } +} +#Adds Base Type Test Cases +Function Add-BaseTypeTestCase +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True, + Position=0)] + [Object]$Root, + [parameter(Mandatory=$True, + Position=1)] + [Object]$Type, + [parameter(Mandatory=$True, + Position=2)] + [Object]$Branch + ) + Try + { + Write-Verbose "Add-BaseTypeTestCase Type.FullName=$($Type.FullName)" + $BaseType=$Type.BaseType + Write-Debug "Add-BaseTypeTestCase Type.BaseType=$BaseType" + If ($BaseType -NE $Null) + { + $BaseTypeBranch = Add-BaseTypeTestCase $Root $BaseType $Branch + $BaseTypeLeaf = Add-TestCaseLeaf $BaseTypeBranch $Type.FullName $Branch + + } + Else + { + $BaseTypeBranch = Add-TestCaseBranch $Root $Type.Name + } + $BaseTypeBranch + } + Catch + { + Write-Verbose "Add-BaseTypeTestCase Catch" + Write-Verbose $_.Exception.Message + } +} +#Add TreeView nodes for Test Cases +Function Add-ValueTypeTestCase +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True, + Position=0)] + [Object]$Root, + [parameter(Mandatory=$True, + Position=1)] + [String]$Key, + [parameter(Mandatory=$True, + Position=2)] + [Object]$Value + ) + Try + { + Write-Verbose " " + Write-Verbose "Add-ValueTypeTestCase Key=$Key" + $GetType=$Value.GetType() + Write-Debug "Add-ValueTypeTestCase GetType=$GetType" + $Level1=Add-TestCaseBranch $Root $GetType.BaseType.Name + $Level2=Add-TestCaseBranch $Level1 $GetType.FullName + $Level3=Add-TestCaseBranch $Level2 "[$($GetType.Name)]Test Cases" + $ValueLeaf=Add-TestCaseLeaf $Level3 $Key $Value + $TypeLeaf =Add-TestCaseLeaf $Level2 "[$($GetType.FullName)]" $GetType + $BaseLeaf =Add-BaseTypeTestCase $Root $GetType.BaseType $Level1 + $ArrayLeaf=Add-ArrayTestCase $Root $GetType.FullName $Value + $ArrayBranch=Add-TestCaseLeaf $Level2 ($GetType.FullName+"[]") $ArrayLeaf + + $ArrayKey="[$($GetType.Name)[]]Test Case" + $Array=$ArrayLeaf[$ArrayKey] + $ArrayFullName=$Array.GetType().FullName + + $ObjectKey="Object[]Test Case" + $ObjectLevel1=Add-TestCaseBranch $Root "Array" + $ObjectLevel2=Add-TestCaseBranch $ObjectLevel1 "System.Object[]" + $ObjectArray = $ObjectLevel2[$ObjectKey] + + $TypeFound=$False + $TypeIndex=-1 + FOR ($I=0;$I -LT $ObjectArray.Count;$I++) + { + $Elements=$ObjectArray[$I] + $ElementsFullName=$Elements.GetType().FullName + IF ($ElementsFullName -EQ $ArrayFullName) + { + $TypeFound=$True + $TypeIndex = $I + break + } + } + Write-Debug "Add-ValueTypeTestCase TypeFound=$TypeFound" + IF ($TypeFound) + { + $ObjectArray[$TypeIndex] = $Array + } + Else + { + $NewObjectArray = $ObjectArray + @($Array) + $NewObjectArray[$ObjectArray.Count] = $Array + $ObjectLevel2[$ObjectKey]=$NewObjectArray + } + Add-PSCustomObjectTestCase $Root $Key $Value $GetType + } + Catch + { + Write-Verbose "Add-ValueTypeTestCase Catch" + Write-Verbose $_.Exception.Message + } +} +#Add Test Cases +Function Add-TestCases +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "Add-TestCases" + $TestCases=[ordered]@{} + $ObjectBranch = Add-TestCaseBranch $TestCases "Object" + $ValueTypeBranch = Add-TestCaseBranch $TestCases "ValueType" + $StringBranch = Add-TestCaseBranch $TestCases "String" + $EnumBranch = Add-TestCaseBranch $TestCases "Enum" + $ArrayBranch = Add-TestCaseBranch $TestCases "Array" + $PSObjectBranch = Add-TestCaseBranch $TestCases "PSCustomObject" + $ObjectArrayBranch = Add-TestCaseBranch $ArrayBranch "System.Object[]" + $ObjectArrayLeaf = Add-TestCaseLeaf $ObjectArrayBranch "Object[]Test Case" @() + $ObjectArrayTypeLeaf = Add-TestCaseLeaf $ObjectArrayBranch "[System.Object[]]" ((@()).GetType()) + $ObjectLeaf = Add-TestCaseLeaf $ObjectBranch "System.Object" $ObjectBranch + $ValueTypeLeaf = Add-TestCaseLeaf $ObjectBranch "System.ValueType" $ValueTypeBranch + $StringLeaf = Add-TestCaseLeaf $ObjectBranch "System.String" $StringBranch + $EnumLeaf = Add-TestCaseLeaf $ObjectBranch "System.Enum" $EnumBranch + $ArrayLeaf = Add-TestCaseLeaf $ObjectBranch "System.Array" $ArrayBranch + $PSObjectLeaf = Add-TestCaseLeaf $ObjectBranch "System.Management.Automation.PSCustomObject" $PSObjectBranch + + #System.Boolean + Add-ValueTypeTestCase $TestCases '[Boolean]$True' ([Boolean]$True) + Add-ValueTypeTestCase $TestCases '[Boolean]$False' ([Boolean]$False) + #System.Byte + Add-ValueTypeTestCase $TestCases '[Byte]0' ([Byte]0) + Add-ValueTypeTestCase $TestCases '[Byte]1' ([Byte]1) + Add-ValueTypeTestCase $TestCases '[Byte]::MinValue' ([Byte]::MinValue) + Add-ValueTypeTestCase $TestCases '[Byte]::MaxValue' ([Byte]::MaxValue) + #System.SByte + Add-ValueTypeTestCase $TestCases '[SByte]0' ([SByte]0) + Add-ValueTypeTestCase $TestCases '[SByte]1' ([SByte]1) + Add-ValueTypeTestCase $TestCases '[SByte]::MinValue' ([SByte]::MinValue) + Add-ValueTypeTestCase $TestCases '[SByte]::MaxValue' ([SByte]::MaxValue) + #System.UInt16 + Add-ValueTypeTestCase $TestCases '[UInt16]0' ([UInt16]0) + Add-ValueTypeTestCase $TestCases '[UInt16]1' ([UInt16]1) + Add-ValueTypeTestCase $TestCases '[UInt16]::MinValue' ([UInt16]::MinValue) + Add-ValueTypeTestCase $TestCases '[UInt16]::MaxValue' ([UInt16]::MaxValue) + #System.Int16 + Add-ValueTypeTestCase $TestCases '[Int16]0' ([Int16]0) + Add-ValueTypeTestCase $TestCases '[Int16]1' ([Int16]1) + Add-ValueTypeTestCase $TestCases '[Int16]::MinValue' ([Int16]::MinValue) + Add-ValueTypeTestCase $TestCases '[Int16]::MaxValue' ([Int16]::MaxValue) + #System.UInt32 + Add-ValueTypeTestCase $TestCases '[UInt32]0' ([UInt32]0) + Add-ValueTypeTestCase $TestCases '[UInt32]1' ([UInt32]1) + Add-ValueTypeTestCase $TestCases '[UInt32]::MinValue' ([UInt32]::MinValue) + Add-ValueTypeTestCase $TestCases '[UInt32]::MaxValue' ([UInt32]::MaxValue) + #System.Int32 + Add-ValueTypeTestCase $TestCases '[Int32]0' ([Int32]0) + Add-ValueTypeTestCase $TestCases '[Int32]1' ([Int32]1) + Add-ValueTypeTestCase $TestCases '[Int32]::MinValue' ([Int32]::MinValue) + Add-ValueTypeTestCase $TestCases '[Int32]::MaxValue' ([Int32]::MaxValue) + #System.UInt64 + Add-ValueTypeTestCase $TestCases '[UInt64]0' ([UInt64]0) + Add-ValueTypeTestCase $TestCases '[UInt64]1' ([UInt64]1) + Add-ValueTypeTestCase $TestCases '[UInt64]::MinValue' ([UInt64]::MinValue) + Add-ValueTypeTestCase $TestCases '[UInt64]::MaxValue' ([UInt64]::MaxValue) + #System.Int64 + Add-ValueTypeTestCase $TestCases '[Int64]0' ([Int64]0) + Add-ValueTypeTestCase $TestCases '[Int64]1' ([Int64]1) + Add-ValueTypeTestCase $TestCases '[Int64]::MinValue' ([Int64]::MinValue) + Add-ValueTypeTestCase $TestCases '[Int64]::MaxValue' ([Int64]::MaxValue) + #System.Int + Add-ValueTypeTestCase $TestCases '[Int]0' ([Int]0) + Add-ValueTypeTestCase $TestCases '[Int]1' ([Int]1) + Add-ValueTypeTestCase $TestCases '[Int]::MinValue' ([Int]::MinValue) + Add-ValueTypeTestCase $TestCases '[Int]::MaxValue' ([Int]::MaxValue) + #System.Long + Add-ValueTypeTestCase $TestCases '[Long]0' ([Long]0) + Add-ValueTypeTestCase $TestCases '[Long]1' ([Long]1) + Add-ValueTypeTestCase $TestCases '[Long]::MinValue' ([Long]::MinValue) + Add-ValueTypeTestCase $TestCases '[Long]::MaxValue' ([Long]::MaxValue) + #System.Single + Add-ValueTypeTestCase $TestCases '[Single]0' ([Single]0) + Add-ValueTypeTestCase $TestCases '[Single]1' ([Single]1) + Add-ValueTypeTestCase $TestCases '[Single]::MinValue' ([Single]::MinValue) + Add-ValueTypeTestCase $TestCases '[Single]::MaxValue' ([Single]::MaxValue) + Add-ValueTypeTestCase $TestCases '[Single]::Epsilon' ([Single]::Epsilon) + Add-ValueTypeTestCase $TestCases '[Single]::NegativeInfinity' ([Single]::NegativeInfinity) + Add-ValueTypeTestCase $TestCases '[Single]::PositiveInfinity' ([Single]::PositiveInfinity) + #System.Double + Add-ValueTypeTestCase $TestCases '[Double]0' ([Double]0) + Add-ValueTypeTestCase $TestCases '[Double]1' ([Double]1) + Add-ValueTypeTestCase $TestCases '[Double]::MinValue' ([Double]::MinValue) + Add-ValueTypeTestCase $TestCases '[Double]::MaxValue' ([Double]::MaxValue) + Add-ValueTypeTestCase $TestCases '[Double]::Epsilon' ([Double]::Epsilon) + Add-ValueTypeTestCase $TestCases '[Double]::NegativeInfinity' ([Double]::NegativeInfinity) + Add-ValueTypeTestCase $TestCases '[Double]::PositiveInfinity' ([Double]::PositiveInfinity) + #System.Float + Add-ValueTypeTestCase $TestCases '[Float]0' ([Float]0) + Add-ValueTypeTestCase $TestCases '[Float]1' ([Float]1) + Add-ValueTypeTestCase $TestCases '[Float]::MinValue' ([Float]::MinValue) + Add-ValueTypeTestCase $TestCases '[Float]::MaxValue' ([Float]::MaxValue) + Add-ValueTypeTestCase $TestCases '[Float]::Epsilon' ([Float]::Epsilon) + Add-ValueTypeTestCase $TestCases '[Float]::NegativeInfinity' ([Float]::NegativeInfinity) + Add-ValueTypeTestCase $TestCases '[Float]::PositiveInfinity' ([Float]::PositiveInfinity) + #System.Decimal + Add-ValueTypeTestCase $TestCases '[Decimal]0' ([Decimal]0) + Add-ValueTypeTestCase $TestCases '[Decimal]1' ([Decimal]1) + Add-ValueTypeTestCase $TestCases '[Decimal]::MinValue' ([Decimal]::MinValue) + Add-ValueTypeTestCase $TestCases '[Decimal]::MaxValue' ([Decimal]::MaxValue) + Add-ValueTypeTestCase $TestCases '[Decimal]::MinusOne' ([Decimal]::MinusOne) + Add-ValueTypeTestCase $TestCases '[Decimal]::Zero' ([Decimal]::Zero) + Add-ValueTypeTestCase $TestCases '[Decimal]::One' ([Decimal]::One) + #System.Math + Add-ValueTypeTestCase $TestCases '[Math]::PI' ([Math]::PI) + Add-ValueTypeTestCase $TestCases '[Math]::E' ([Math]::E) + #System.Numerics.BigInteger + Add-ValueTypeTestCase $TestCases '[System.Numerics.BigInteger]::Zero' ([System.Numerics.BigInteger]::Zero) + Add-ValueTypeTestCase $TestCases '[System.Numerics.BigInteger]::One' ([System.Numerics.BigInteger]::One) + Add-ValueTypeTestCase $TestCases '[System.Numerics.BigInteger]::MinusOne' ([System.Numerics.BigInteger]::MinusOne) + #System.Numerics.Complex + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::Zero' ([System.Numerics.Complex]::Zero) + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::One' ([System.Numerics.Complex]::One) + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::ImaginaryOne' ([System.Numerics.Complex]::ImaginaryOne) + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::Zero+[Math]::PI' ([System.Numerics.Complex]::Zero+[Math]::PI) + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::Zero+[Math]::E' ([System.Numerics.Complex]::Zero+[Math]::E) + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::One *[Math]::PI' ([System.Numerics.Complex]::One*[Math]::PI) + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::One *[Math]::E' ([System.Numerics.Complex]::One*[Math]::E) + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::ImaginaryOne*[Math]::PI' ([System.Numerics.Complex]::ImaginaryOne*[Math]::PI) + Add-ValueTypeTestCase $TestCases '[System.Numerics.Complex]::ImaginaryOne*[Math]::E' ([System.Numerics.Complex]::ImaginaryOne*[Math]::E) + #System.Char + Add-ValueTypeTestCase $TestCases '[Char]''A''' ([Char]'A') + Add-ValueTypeTestCase $TestCases '[Char]::MinValue' ([Char]::MinValue) + Add-ValueTypeTestCase $TestCases '[Char]::MaxValue' ([Char]::MaxValue) + #System.String + Add-ValueTypeTestCase $TestCases '[String]"A"' ([String]"A") + Add-ValueTypeTestCase $TestCases '[String]::Empty' ([String]::Empty) + #System.DateTime + Add-ValueTypeTestCase $TestCases '[DateTime]Get-Date' (Get-Date) + #System.TimeSpan + Add-ValueTypeTestCase $TestCases '[TimeSpan](Get-Date).TimeOfDay' ((Get-Date).TimeOfDay) + #System.DayOfWeek + Add-ValueTypeTestCase $TestCases '[DayOfWeek](Get-Date).DayOfWeek' ((Get-Date).DayOfWeek) + #System.Guid + Add-ValueTypeTestCase $TestCases '[Guid][System.Guid]::NewGuid()' ([System.Guid]::NewGuid()) + + $TestCases + } + Catch + { + Write-Verbose "Add-TestCases Catch" + Write-Verbose $_.Exception.Message + } +} + +#Add TreeView nodes for Test Cases +Function Add-TestCaseNodes +{ + [CmdletBinding()] + param ( [parameter(Mandatory=$True,Position=0)] + [System.Windows.Forms.TreeView]$TreeView + ) + Try + { + Write-Verbose "Add-TestCaseNodes" + + $TestCases=Add-TestCases + + $Index=0 + IF ($mnuWMIObjects.Checked) {$Index++} + IF ($mnuNetAssemblies.Checked) {$Index++} + IF ($mnuNetClasses.Checked) {$Index++} + IF ($mnuPSAliases.Checked) {$Index++} + IF ($mnuPSCommands.Checked) {$Index++} + IF ($mnuPSDrives.Checked) {$Index++} + IF ($mnuPSModules.Checked) {$Index++} + IF ($mnuPSVariables.Checked) {$Index++} + IF ($mnuWINFeature.Checked) {$Index++} + IF ($mnuWINProcess.Checked) {$Index++} + IF ($mnuWINService.Checked) {$Index++} + $Node = $TreeView.Nodes.Insert($Index,((Get-NextKey)+" " +"Test Cases"),"Test Cases") + $Node.Tag=$TestCases + $Node.EnsureVisible() + $Node + } + Catch + { + Write-Verbose "Add-TestCaseNodes Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion + +#Clears a listview columnns and items +Function Clear-ListView +{ + [CmdletBinding()] + param( + [parameter(Mandatory=$True)] + [System.Windows.Forms.ListView]$ListView + ) + Write-Verbose "Clear-ListView" + $ListView.Items.Clear() + $ListView.Columns.Clear() +} + +#Fills Listview with a class defintion +Function Fill-ListViewClass +{ + [CmdletBinding()] + param ( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [parameter(Mandatory=$True)] + [object]$Object + ) + Try + { + Write-Verbose "Fill-ListViewClass" + Clear-ListView $ListViewClass + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Member Type") + $Column.Width=$ListView.Width *.14 + $Column=$ListView.Columns.Add("Return Type") + $Column.Width=$ListView.Width *.30 + $Column=$ListView.Columns.Add("Definition") + $Column.Width=$ListView.Width *.52 + ForEach ($M in (Get-Member -InputObject $Object)) + { + [String]$MemberName = $M.Name + [String]$MemberType = $M.MemberType + [String]$MemberTypeName = $M.TypeName + [String]$MemberDefinition = $M.Definition + $Space = $MemberDefinition.IndexOf(" ") + [String]$ReturnType = $MemberDefinition.Substring(0,$Space) + [String]$Definition = $MemberDefinition.Substring($Space+1) + $Item=$ListView.Items.Add($MemberType) + $Item.SubItems.Add($ReturnType) + $Item.SubItems.Add($Definition) + } + } + Catch [System.Exception] + { + Write-Verbose "Fill-ListViewClass Catch" + Write-Verbose $_.Exception.Message + } +} + +#Creates a PSObject definition from a object +Function Get-PSObjectTextFromObject +{ + [CmdletBinding()] + [OutputType([string])] + param( + [Parameter(Mandatory=$true)] + [String]$Class, + [Parameter(Mandatory=$true)] + [Object]$Object + ) + Try + { + Write-Verbose "Get-PSObjectTextFromObject" + $Members=Get-Member -InputObject $Object + $ValidPropertyType = @{"{get;set;}"=$True;"{get;}"=$True;} + $ValidReturnType = @{"bool"=$True;"byte"=$True;"string"=$True;"string[]"=$True; + "int"=$True;"int16"=$True;"int32"=$True;"int64"=$True; + "uint"=$True;"uint16"=$True;"uint32"=$True;"uint64"=$True;"long"=$True; + "datetime"=$True;"timespan"=$True; + "system.boolean"=$True;"system.byte"=$True;"system.string"=$True;"system.string[]"=$True; + "system.int"=$True;"system.int16"=$True;"system.int32"=$True;"system.int64"=$True; + "system.uint"=$True;"system.uint16"=$True;"system.uint32"=$True;"system.uint64"=$True;"system.long"=$True; + "system.datetime"=$True;"system.timespan"=$True + } + [string]$String="" + $String=$String+"New-Object PSObject -Property ([Ordered]@{ `r`n" + + ForEach ($Member in $Members) + { + IF ($Member.MemberType -EQ "Property" -OR $Member.MemberType -EQ "NoteProperty") + { + [string]$Name=$Member.Name + IF ($Name.Substring(0,1) -NE "_") + { + IF (-NOT $Name.Contains("-")) + { + [String[]]$Definition=$Member.Definition.Split(" ") + [string]$PropertyType=$Definition[2] + IF ($ValidPropertyType[$PropertyType]) + { + $ReturnType=$Definition[0] + If ($ValidReturnType[$ReturnType]) + { + $String=$String+" $Name="+"$"+"$Class.$Name `r`n" + } + } + } + } + } + } + $String=$String+"}) `r`n" + $String + } + Catch [System.Exception] + { + Write-Verbose "Get-PSObjectTextFromObject Catch" + Write-Verbose $_.Exception.Message + } +} + +#Prepare ListView For ValueType Instance +Function Prepare-ListViewForValueType +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView + ) + Try + { + Write-Verbose "Prepare-ListViewForValueType" + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Type") + $Column.Width=$ListView.Width *.45 + $Column=$ListView.Columns.Add("Value") + $Column.Width=$ListView.Width *.54 + } + Catch [System.Exception] + { + Write-Verbose "Prepare-ListViewForValueType Catch" + Write-Verbose $_.Exception.Message + } +} + +#Prepare ListView For Object Instance +Function Prepare-ListViewForObject +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView + ) + Try + { + Write-Verbose "Prepare-ListViewForObject" + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Property") + $Column.Width=$ListView.Width *.45 + $Column=$ListView.Columns.Add("Value") + $Column.Width=$ListView.Width *.54 + } + Catch [System.Exception] + { + Write-Verbose "Prepare-ListViewForObject Catch" + Write-Verbose $_.Exception.Message + } +} + +#Prepare ListView For Array Instance +Function Prepare-ListViewForArray +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView + ) + Try + { + Write-Verbose "Prepare-ListViewForArray" + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Element") + $Column.Width=$ListView.Width *.45 + $Column=$ListView.Columns.Add("Value") + $Column.Width=$ListView.Width *.54 + } + Catch [System.Exception] + { + Write-Verbose "Prepare-ListViewForArray Catch" + Write-Verbose $_.Exception.Message + } +} + +#Prepare ListView For Collection Instance +Function Prepare-ListViewForCollection +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView + ) + Try + { + Write-Verbose "Prepare-ListViewForCollection" + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Item") + $Column.Width=$ListView.Width *.45 + $Column=$ListView.Columns.Add("Value") + $Column.Width=$ListView.Width *.54 + } + Catch [System.Exception] + { + Write-Verbose "Prepare-ListViewForCollection Catch" + Write-Verbose $_.Exception.Message + } +} + +#Prepare ListView For HashTable Instance +Function Prepare-ListViewForHashTable +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView + ) + Try + { + Write-Verbose "Prepare-ListViewForHashTable" + Clear-ListView $ListView + $ListView.View = [System.Windows.Forms.View]::Details + $Column=$ListView.Columns.Add("Key") + $Column.Width=$ListView.Width *.45 + $Column=$ListView.Columns.Add("Value") + $Column.Width=$ListView.Width *.54 + } + Catch [System.Exception] + { + Write-Verbose "Prepare-ListViewForHashTable Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process a Boolean Property +Function Process-BooleanProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.String]$PropertyName, + [Parameter(Mandatory=$true)] + [System.Boolean]$Boolean + ) + Try + { + Write-Verbose "Process-BooleanProperty PropertyName=$PropertyName Value=$Boolean" + $Item=$ListView.Items.Add($PropertyName) + IF ($Boolean) + { + $Item.SubItems.Add("True") + } + Else + { + $Item.SubItems.Add("False") + } + $Script:POEValues += "$PropertyName = $Boolean `r`n" + } + Catch [System.Exception] + { + Write-Verbose "Process-BooleanProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process a ValueType Property +Function Process-ValueTypeProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$ValueType + ) + Try + { + Write-Verbose "Process-ValueTypeProperty PropertyName=$PropertyName Value=$ValueType" + $Item=$ListView.Items.Add($PropertyName) + $Item.SubItems.Add($ValueType.ToString()) + $Script:POEValues += "$PropertyName = $ValueType `r`n" + } + Catch [System.Exception] + { + Write-Verbose "Process-ValueTypeProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process a String Property +Function Process-StringProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.String]$PropertyName, + [Parameter(Mandatory=$true)] + [System.String]$String + ) + Try + { + Write-Verbose "Process-StringProperty PropertyName=$PropertyName Value=$String" + $Item=$ListView.Items.Add($PropertyName) + $Item.SubItems.Add($String) + $Script:POEValues += "$PropertyName = $String `r`n" + } + Catch [System.Exception] + { + Write-Verbose "Process-StringProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process a ValueType Note Property +Function Process-ValueTypeNoteProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$PropertyValue + ) + Try + { + Write-Verbose "Process-ValueTypeNoteProperty PropertyName=$PropertyName PropertyValue=$PropertyValue" + $Item=$ListView.Items.Add($PropertyName) + $Item.SubItems.Add($PropertyValue) + $Script:POEValues += "$PropertyName = $PropertyValue `r`n" + } + Catch [System.Exception] + { + Write-Verbose "Process-ValueTypeNoteProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process An Enum Property +Function Process-EnumProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$Enum + ) + Try + { + Write-Verbose "Process-EnumProperty PropertyName=$PropertyName PropertyValue=$Enum" + $Item=$ListView.Items.Add($PropertyName) + $Item.SubItems.Add("[$($Enum.GetType().FullName)]::$($Enum.ToString())") + $Script:POEValues += "$PropertyName = [$($Enum.GetType().FullName)]::$($Enum.ToString()) `r`n" + } + Catch [System.Exception] + { + Write-Verbose "Process-EnumProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process An Struct Property +Function Process-StructProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$Struct + ) + Try + { + Write-Verbose "Process-StructProperty PropertyName=$PropertyName" + Write-Verbose "Process-StructProperty ObjectType=$($Struct.GetType().FullName)" + Process-ValueTypeProperty $ListView $PropertyName (Get-PropertyFriendlyName $Struct) + If ($mnuStructs.Checked) + { + Add-TreeNode $TreeView.SelectedNode $Struct $PropertyName + } + } + Catch [System.Exception] + { + Write-Verbose "Process-StructProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process an Object Property +Function Process-ObjectProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$Object + ) + Try + { + Write-Verbose "Process-ObjectProperty PropertyName=$PropertyName" + Write-Verbose "Process-ObjectProperty ObjectType=$($Object.GetType().FullName)" + Process-ValueTypeProperty $ListView $PropertyName (Get-PropertyFriendlyName $Object) + If ($mnuObjects.Checked) + { + Add-TreeNode $TreeView.SelectedNode $Object $PropertyName + } + } + Catch [System.Exception] + { + Write-Verbose "Process-ObjectProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process an Array Property +Function Process-ArrayProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$Array + ) + Try + { + $ArrayType = $Array.GetType().FullName + $ArrayCount = $Array.Count + Write-Verbose "Process-ArrayInstance $ArrayType.Count=$ArrayCount" + $StatusBarText = $StatusBar.Text + $Node =Add-TreeNode $TreeView.SelectedNode $Array $PropertyName + [Int]$I=0 + ForEach($Object in $Array) + { + $StatusBar.Text = "$StatusBarText $ArrayType ($I of $ArrayCount)" + $ChildNode =Add-TreeNode $Node $Object + $I++ + } + If ($mnuCollections.Checked) + { + Process-ValueTypeProperty $ListView $PropertyName (Get-PropertyFriendlyName $Array) + } + $StatusBar.Text = $StatusBarText + } + Catch [System.Exception] + { + Write-Verbose "Process-ArrayProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A Collection Property +Function Process-CollectionProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$Collection + ) + Try + { + $CollectionType = $Collection.GetType().FullName + $CollectionCount = $Collection.Count + Write-Verbose "Process-CollectionInstance $CollectionType.Count=$CollectionCount" + $StatusBarText = $StatusBar.Text + $Node =Add-TreeNode $TreeView.SelectedNode $Collection $PropertyName + [Int]$I=0 + ForEach($Object in $Collection) + { + $StatusBar.Text = "$StatusBarText $CollectionType ($I of $CollectionCount)" + $ChildNode =Add-TreeNode $Node $Object + $I++ + } + If ($mnuCollections.Checked) + { + Process-ValueTypeProperty $ListView $PropertyName (Get-PropertyFriendlyName $Collection) + } + $StatusBar.Text = $StatusBarText + } + Catch [System.Exception] + { + Write-Verbose "Process-CollectionProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A HashTable Property +Function Process-HashTableProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$HashTable + ) + Try + { + $HashTableType = $HashTable.GetType().FullName + $HashTableCount = $HashTable.Count + Write-Verbose "Process-HashTableProperty $HashTableType.Count=$HashTableCount" + $StatusBarText = $StatusBar.Text + $Node=Add-TreeNode $TreeView.SelectedNode $HashTable $PropertyName + [Int]$I=0 + $Keys=$HashTable.Keys + ForEach($Key In $Keys) + { + $StatusBar.Text = "$StatusBarText $HashTableType ($($I+1) of $HashTableCount)" + IF ($HashTable[$Key] -NE $Null) + { + $ChildNode=Add-TreeNode $Node $HashTable[$Key] $Key + } + Else + { + $ChildNode=Add-TreeNode $Node "Null" $Key + } + $I++ + } + If ($mnuCollections.Checked) + { + Process-ValueTypeProperty $ListView $PropertyName (Get-PropertyFriendlyName $HashTable) + } + $StatusBar.Text = $StatusBarText + } + Catch [System.Exception] + { + Write-Verbose "Process-HashTableProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A Dictionary Property +Function Process-DictionaryProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [String]$PropertyName, + [Parameter(Mandatory=$true)] + [Object]$Dictionary + ) + Try + { + $DictionaryType = $Dictionary.GetType().FullName + $DictionaryCount = $Dictionary.Count + Write-Verbose "Process-DictionaryInstance $DictionaryType.Count=$DictionaryCount" + $StatusBarText = $StatusBar.Text + $Node=Add-TreeNode $TreeView.SelectedNode $Dictionary $PropertyName + [Int]$I=0 + ForEach($Key In $Keys) + { + $StatusBar.Text = "$StatusBarText $DictionaryType ($($I+1) of $DictionaryCount)" + IF ($Dictionary[$Key] -NE $Null) + { + $ChildNode=Add-TreeNode $Node $Dictionary[$Key] $Key + } + Else + { + $ChildNode=Add-TreeNode $Node "Null" $Key + } + $I++ + } + If ($mnuCollections.Checked) + { + Process-ValueTypeProperty $ListView $PropertyName (Get-PropertyFriendlyName $Dictionary) + } + $StatusBar.Text = $StatusBarText + } + Catch [System.Exception] + { + Write-Verbose "Process-DictionaryProperty Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A Boolean Instance +Function Process-BooleanInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [System.Boolean]$Boolean + ) + Try + { + Write-Verbose "Process-BooleanInstance $Boolean" + Prepare-ListViewForValueType $ListView + Process-BooleanProperty $ListView "Boolean" $Boolean + $StatusBar.Text="System.Boolean" + } + Catch [System.Exception] + { + Write-Verbose "Process-ArrayBoolean Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A ValueType Instance +Function Process-ValueTypeInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [Object]$ValueType + ) + Try + { + Write-Verbose "Process-ValueTypeInstance $($ValueType.GetType().Name)=$ValueType" + Prepare-ListViewForValueType $ListView + Process-ValueTypeProperty $ListView $ValueType.GetType().Name $ValueType + $StatusBar.Text="$($ValueType.GetType().FullName)" + } + Catch [System.Exception] + { + Write-Verbose "Process-ValueTypeInstance Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A String Instance +Function Process-StringInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [System.String]$String + ) + Try + { + Write-Verbose "Process-StringInstance $($String.GetType().Name)=$String" + Prepare-ListViewForValueType $ListView + Process-ValueTypeProperty $ListView "String" $String + Process-ValueTypeProperty $ListView "Length" $String.Length + $StatusBar.Text="$($String.GetType().FullName)" + } + Catch [System.Exception] + { + Write-Verbose "Process-StringInstance Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A Enum Instance +Function Process-EnumInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [Object]$Enum + ) + Try + { + Write-Verbose "Process-EnumInstance [$($Enum.GetType().FullName)]::$Enum" + Prepare-ListViewForValueType $ListView + Process-EnumProperty $ListView $Enum.GetType().Name $Enum + $StatusBar.Text="$($Enum.GetType().FullName)" + } + Catch [System.Exception] + { + Write-Verbose "Process-EnumInstance Catch" + Write-Verbose $_.Exception.Message + } +} + +#Gets object's property +Function Get-ObjectInstanceProperty +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [Object]$Object, + [Parameter(Mandatory=$true)] + [System.String]$Property, + [Parameter(Mandatory=$true)] + [System.String]$PropertyType + ) + Try + { + Write-Verbose "Get-ObjectInstanceProperty Object=$($Object.GetType().FullName) Property=$Property" + $ObjectProperty=$Null + $String="[$PropertyType]"+"$"+"ObjectProperty="+"$"+"Object.$Property" + Write-Verbose "Get-ObjectInstanceProperty String=$String" + Invoke-Expression $String + Write-Verbose "Get-ObjectInstanceProperty ObjectProperty=$($ObjectProperty.GetType().FullName)" + $ObjectProperty + } + Catch [System.Exception] + { + Write-Verbose "Get-ObjectInstanceProperty Catch" + Write-Error $_.Exception.Message + $Null + } +} + +#Process An Object Instance +Function Process-ObjectInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [Object]$Object + ) + Try + { + $ObjectType = $Object.GetType().FullName + Write-Verbose "Process-ObjectInstance ObjectType=$ObjectType" + $Node=$TreeView.SelectedNode + $Node.Nodes.Clear() + Prepare-ListViewForObject $ListView + $Members=Get-Member -InputObject $Object + $MemberCount = $Members.Count + $MemberIndex = 0 + [string]$String="" + ForEach ($Member in $Members) + { + Write-Verbose " " + [String]$MemberTypeName=$Member.TypeName + Write-Verbose "Process-ObjectInstance MemberTypeName=$MemberTypeName" + [String]$MemberName=$Member.Name + Write-Verbose "Process-ObjectInstance MemberName=$MemberName" + [String]$MemberType=$Member.MemberType + $MemberIndex++ + $StatusBar.Text = "Processing $MemberTypeName $MemberType[$MemberIndex of $MemberCount] $MemberName" + If ($Script:IsValidMemberType[$MemberType]) + { + Write-Verbose "Process-ObjectInstance MemberType=$MemberType" + If (Get-IsValidMemberName $MemberName $MemberTypeName) + { + [String[]]$Definition=$Member.Definition.Split(" ") + [String]$PropertyType=$Definition[2] + Write-Verbose "Process-ObjectInstance PropertyType=$PropertyType" + [String]$MemberReturnType=$Definition[0] + Write-Verbose "Process-ObjectInstance MemberReturnType=$MemberReturnType" + If ($MemberType -EQ "Property") + { + If ($Script:IsValidPropertyType[$PropertyType]) + { + $ObjectProperty=$Null + $String="[$MemberReturnType]"+"$"+"ObjectProperty="+"$"+"Object.$MemberName" + Write-Verbose "Process-ObjectInstance InvokeProperty=$String" + + Trap { Write-Verbose "Process-ObjectInstance Trapped Error" + Continue + } + Invoke-Expression $String + If ($ObjectProperty -NE $Null) + { + Write-Verbose "Process-ObjectInstance ObjectProperty.Type=$($ObjectProperty.GetType().FullName)" +# If ($mnuCaptureTypes.Checked) +# { +# Add-PSTypeNames $ObjectProperty +# } + $ObjectPropertyType = Get-PropertyReturnType $ObjectProperty + Write-Verbose "Process-ObjectInstance ObjectPropertyType=$ObjectPropertyType" + Switch($ObjectPropertyType) + { + "Boolean" + { + Write-Verbose "Process-ObjectInstance Boolean" + Process-BooleanProperty $ListView $MemberName $ObjectProperty + Continue + } + "ValueType" + { + Write-Verbose "Process-ObjectInstance ValueType" + Process-ValueTypeProperty $ListView $MemberName $ObjectProperty + Continue + } + "String" + { + Write-Verbose "Process-ObjectInstance String" + If ([string]::IsNullOrEmpty($ObjectProperty)) + { + If ($ObjectProperty -EQ $Null) + { + Process-StringProperty $ListView $MemberName "NULL" + } + Else + { + Process-StringProperty $ListView $MemberName "[System.String]::EmptyString" + } + } + Else + { + Process-StringProperty $ListView $MemberName $ObjectProperty + } + Continue + } + "Enum" + { + Write-Verbose "Process-ObjectInstance Enum" + Process-EnumProperty $ListView $MemberName $ObjectProperty + Continue + } + "Struct" + { + Write-Verbose "Process-ObjectInstance Struct" + Process-StructProperty $TreeView $ListView $MemberName $ObjectProperty + Continue + } + "Object" + { + Write-Verbose "Process-ObjectProperty Object" + Process-ObjectProperty $TreeView $ListView $MemberName $ObjectProperty + Continue + } + "Array" + { + Write-Verbose "Process-ObjectProperty Array" + Process-ArrayProperty $TreeView $ListView $StatusBar $MemberName $ObjectProperty + Continue + } + "Collection" + { + Write-Verbose "Process-ObjectInstance Collection" + Process-CollectionProperty $TreeView $ListView $StatusBar $MemberName $ObjectProperty + Continue + } + "HashTable" + { + Write-Verbose "Process-ObjectInstance HashTable" + Process-HashTableProperty $TreeView $ListView $StatusBar $MemberName $ObjectProperty + Continue + } + "Dictionary" + { + Write-Verbose "Process-ObjectInstance Dictionary" + Process-DictionaryProperty $TreeView $ListView $StatusBar $MemberName $ObjectProperty + Continue + } + Default + { + Write-Verbose "Process-ObjectInstance Unknown" + Process-ObjectProperty $TreeView $ListView $MemberName $ObjectProperty + Continue + } + } + } + Else + { + Write-Verbose "Process-ObjectInstance PropertyName=$MemberName Is Null" + If ($mnuNulls.Checked) + { + Process-ValueTypeProperty $ListView $MemberName "Null" + } + } + } + Else + { + Write-Verbose "Process-ObjectInstance MemberName=$MemberName PropertyType not valid" + } + } + Else + { + Write-Verbose "Process-ObjectInstance MemberName=$MemberName Not a Property" + [String]$PropertyName=$Definition[1] + [String[]]$PropertyNameParts=$PropertyName.Split("=") + [String]$PropertyKey=$PropertyNameParts[0] + [String]$PropertyValue=$PropertyNameParts[1] + Write-Verbose "Process-ObjectInstance PropertyKey=$PropertyKey PropertyValue=$PropertyValue" + If($Script:IsPropertyValueType[$MemberReturnType]) + { + Process-ValueTypeNoteProperty $ListView $PropertyKey $PropertyValue + } + Else + { + Write-Verbose "Process-ObjectInstance MemberTypeName=$MemberTypeName is not PropertyValueType" + } + } + } + Else + { + Write-Verbose "Process-ObjectInstance MemberName=$MemberName not valid" + } + } + Else + { + Write-Verbose "Process-ObjectInstance MemberType=$MemberType not valid" + } + } + $StatusBar.Text = "$ObjectType" + + } + Catch [System.Exception] + { + Write-Verbose "Process-ObjectInstance Catch" + Write-Error $_.Exception.Message + } +} + +#Process An Array Instance +Function Process-ArrayInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [Object]$Array + ) + Try + { + $ArrayType = $Array.GetType().FullName + $ArrayCount = $Array.Count + Write-Verbose "Process-ArrayInstance $ArrayType.Count=$ArrayCount" + $Node = $TreeView.SelectedNode + $Node.Nodes.Clear() + Prepare-ListViewForArray $ListView + [Int]$I=0 + ForEach($Object in $Array) + { + $StatusBar.Text = "$ArrayType ($($I+1) of $ArrayCount)" + $ChildNode =Add-TreeNode $Node $Object + Process-ValueTypeProperty $ListView "$($Node.Text)[$I]" (Get-PropertyFriendlyName $Object) + $I++ + } + $StatusBar.Text = "$ArrayType.Count=$ArrayCount" + } + Catch [System.Exception] + { + Write-Verbose "Process-ArrayInstance Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A Collection Instance +Function Process-CollectionInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [Object]$Collection + ) + Try + { + $CollectionType = $Collection.GetType().FullName + $CollectionCount = $Collection.Count + Write-Verbose "Process-CollectionInstance $CollectionType.Count=$CollectionCount" + $Node = $TreeView.SelectedNode + $Node.Nodes.Clear() + Prepare-ListViewForCollection $ListView + [Int]$I=0 + ForEach($Object In $Collection) + { + $StatusBar.Text = "$CollectionType ($($I+1) of $CollectionCount)" + $ChildNode =Add-TreeNode $Node $Object + Process-ValueTypeProperty $ListView "$($Node.Text)[$I]" (Get-PropertyFriendlyName $Object) + $I++ + } + $StatusBar.Text = "$CollectionType.Count=$CollectionCount" + } + Catch [System.Exception] + { + Write-Verbose "Process-CollectionInstance Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A HashTable Instance +Function Process-HashTableInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [Object]$HashTable + ) + Try + { + $HashTableType=$HashTable.GetType().FullName + $HashTableCount=$HashTable.Count + Write-Verbose "Process-HashTableInstance $HashTableType.Count=$HashTableCount" + $Node = $TreeView.SelectedNode + $Node.Nodes.Clear() + Prepare-ListViewForHashTable $ListView + $Keys=$HashTable.Keys + [Int]$I=0 + ForEach($Key In $Keys) + { + $StatusBar.Text = "$HashTableType ($($I+1) of $HashTableCount)" + IF ($HashTable[$Key] -NE $Null) + { + IF ($HashTable[$Key].Value -NE $NULL) + { + $ChildNode=Add-TreeNode $Node $HashTable[$Key].Value $Key + Process-ValueTypeProperty $ListView $Key (Get-PropertyFriendlyName $HashTable[$Key].Value) + } + Else + { + $ChildNode=Add-TreeNode $Node $HashTable[$Key] $Key + Process-ValueTypeProperty $ListView $Key (Get-PropertyFriendlyName $HashTable[$Key]) + } + } + Else + { + $ChildNode=Add-TreeNode $Node $HashTable[$Key] $Key + Process-ValueTypeProperty $ListView $Key "" + } + $I++ + } + $StatusBar.Text = "$HashTableType.Count=$HashTableCount" + } + Catch [System.Exception] + { + Write-Verbose "Process-HashTableInstance Catch" + Write-Verbose $_.Exception.Message + } +} + +#Process A Dictionary Instance +Function Process-DictionaryInstance +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [System.Windows.Forms.TreeView]$TreeView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.ListView]$ListView, + [Parameter(Mandatory=$true)] + [System.Windows.Forms.StatusBar]$StatusBar, + [Parameter(Mandatory=$true)] + [Object]$Dictionary + ) + Try + { + $DictionaryType=$Dictionary.GetType().FullName + $DictionaryCount=$Dictionary.Count + Write-Verbose "Process-DictionaryInstance $DictionaryType.Count=$DictionaryCount" + $Node = $TreeView.SelectedNode + $Node.Nodes.Clear() + Prepare-ListViewForDictionary $ListView + $Keys=$Dictionary.Keys + [Int]$I=0 + ForEach($Key In $Keys) + { + $StatusBar.Text = "$DictionaryType ($($I+1) of $DictionaryCount)" + IF ($Dictionary[$Key] -NE $Null) + { + IF ($Dictionary[$Key].Value -NE $NULL) + { + $ChildNode=Add-TreeNode $Node $Dictionary[$Key].Value $Key + Process-ValueTypeProperty $ListView $Key (Get-PropertyFriendlyName $Dictionary[$Key].Value) + } + Else + { + $ChildNode=Add-TreeNode $Node $Dictionary[$Key] $Key + Process-ValueTypeProperty $ListView $Key (Get-PropertyFriendlyName $Dictionary[$Key]) + } + } + Else + { + $ChildNode=Add-TreeNode $Node $Dictionary[$Key] $Key + Process-ValueTypeProperty $ListView $Key "" + } + $I++ + } + $StatusBar.Text = "$DictionaryType.Count=$DictionaryCount" + } + Catch [System.Exception] + { + Write-Verbose "Process-DictionaryInstance Catch" + Write-Verbose $_.Exception.Message + } +} + +#region Form +#region Form and Control Events + +#Event Handler for the Powershell prompt execute button +Function ButtonExecute_Click +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [System.Object] $sender + ) + Try + { + Write-Verbose "ButtonExecute_Click" + $TextBoxOutput.Text + $Output = $ExecutionContext.InvokeCommand.InvokeScript($TextBoxPowerShell.Text) + IF ($Output -NE "") + { + ForEach ($Line In $OutPut) + { + $TextBoxOutput.Text += "$Line `r`n" + } + } + } + Catch [System.Exception] + { + Write-Verbose "ButtonExecute_Click Catch" + Write-Error $_.Exception.Message + } +} + +#Event Handler for the SplitContainer event SplitterMoved +Function SplitContainer_SplitterMoved +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True, + Position=0)] + [System.Object] $sender, + [parameter(Mandatory=$True, + Position=1)] + [System.Windows.Forms.SplitterEventArgs] $e + ) + Write-Verbose "SplitContainer_SplitterMoved" + Form_Resize +} + +#Event Handler for the TreeView event AfterSelect +Function TreeView_AfterSelect +{ + [CmdletBinding()] + param ( + [parameter(Mandatory=$True)] + [Object]$Sender, + [parameter(Mandatory=$True)] + [Object]$EventArg + ) + Try + { + Write-Verbose "" + Write-Verbose "TreeView_AfterSelect Sender.Name=$($Sender.Name) EventArg.Node=$($EventArg.Node.Text)" + $Sender.SelectedNode = $EventArg.Node + $TreeView=$Sender + $ListView=$Sender.Tag + $StatusBar=$ListView.Tag + $Node=$Sender.SelectedNode + $Object = $Node.Tag + $Script:POEValues = "" + $TextBoxValues.Text = $Script:POEValues + If (Get-IsWMIObject $Object) + { + Write-Verbose "TreeView_AfterSelect WMIObject" + Process-WMIObjectInstance $TreeView $ListView $StatusBar $Node + $ObjectType="WMIObject" + } + Else + { + $ObjectType = Get-InstanceType $Object + Write-Verbose "TreeView_AfterSelect ObjectType=$ObjectType" + Switch($ObjectType) + { + "Boolean" + { + Write-Verbose "TreeView_AfterSelect Boolean" + Process-BooleanInstance $TreeView $ListView $StatusBar $Object + Continue + } + "ValueType" + { + Write-Verbose "TreeView_AfterSelect ValueType" + Process-ValueTypeInstance $TreeView $ListView $StatusBar $Object + Continue + } + "String" + { + Write-Verbose "TreeView_AfterSelect String" + If([System.String]::IsNullOrEmpty($Object)) + { + If($Object -EQ $Null) + { + Process-StringInstance $TreeView $ListView $StatusBar "Null" + } + Else + { + Process-StringInstance $TreeView $ListView $StatusBar "[System.String]::EmptyString" + } + } + Else + { + Process-StringInstance $TreeView $ListView $StatusBar $Object + } + Continue + } + "Enum" + { + Write-Verbose "TreeView_AfterSelect Enum" + Process-EnumInstance $TreeView $ListView $StatusBar $Object + Continue + } + "Object" + { + Write-Verbose "TreeView_AfterSelect Object" + Process-ObjectInstance $TreeView $ListView $StatusBar $Object + Continue + } + "Array" + { + Write-Verbose "TreeView_AfterSelect Array" + Process-ArrayInstance $TreeView $ListView $StatusBar $Object + Continue + } + "Collection" + { + Write-Verbose "TreeView_AfterSelect Collection" + Process-CollectionInstance $TreeView $ListView $StatusBar $Object + Continue + } + "HashTable" + { + Write-Verbose "TreeView_AfterSelect HashTable" + Process-HashTableInstance $TreeView $ListView $StatusBar $Object + Continue + } + "Dictionary" + { + Write-Verbose "TreeView_AfterSelect Dictionary" + Process-DictionaryInstance $TreeView $ListView $StatusBar $Object + Continue + } + Default + { + Write-Verbose "TreeView_AfterSelect Unknown" + Process-ObjectInstance $TreeView $ListView $StatusBar $Object + Continue + } + } + If ($Sender.Name -EQ "TreeViewInstance") + { + Write-Verbose "TreeView_AfterSelect Fill-ListViewClass" + Fill-ListViewClass $ListViewClass $Object + If ($ObjectType -EQ "WMIObject") + { + Write-Verbose "TreeView_AfterSelect Get-PSObjectTextFromObject WMIObject" + $TextBoxPSObject.Text = Get-PSObjectTextFromObject $Node.Parent.Tag.Class $Object + $StatusBar.Text = $Node.Parent.Tag.Class+" - "+$Node.Parent.Tag.Description + } + ElseIf($ObjectType -EQ "PSObject") + { + Write-Verbose "TreeView_AfterSelect Get-PSObjectTextFromObject PSObject" + $TextBoxPSObject.Text = Get-PSObjectTextFromObject $Object.GetType().Name $Object + } + Else + { + Write-Verbose "TreeView_AfterSelect Get-PSObjectTextFromObject Object" + $TextBoxPSObject.Text = Get-PSObjectTextFromObject $Object.GetType().Name $Object + #$StatusBar.Text = $Object.GetType().FullName + } + $TextBoxValues.Text = $Script:POEValues + Write-Verbose "TreeView_AfterSelect GetTypeNames" + If ($Object -IS [System.Type]) + { + [String[]]$PSTypeNames = @("System.Type","System.Object") + } + ElseIf ($Object -IS [System.Reflection.Assembly]) + + { + [String[]]$PSTypeNames = @("System.Reflection.Assembly","System.Object") + } + ElseIf ($Object -IS [System.Management.Automation.PSCustomObject]) + + { + [String[]]$PSTypeNames = @("System.Management.Automation.PSCustomObject","System.Object") + } + Else + { + [String[]]$PSTypeNames = $Object.PSTypeNames + } + $TreeViewInterface.Nodes.Clear() + Clear-ListView $ListViewInterface + For ($I=0;$I -LT $PSTypeNames.Count;$I++) + { + Write-Verbose "TreeView_AfterSelect PSTypeName=$($PSTypeNames[$I])" + IF ($PSTypeNames[$I].Contains("#")) + { + } + Else + { + $PSTypeName = $PSTypeNames[$I] + Trap {Continue} + $Type = $PSTypeName -As [System.Type] + If ($Type -NE $Null) + { + Add-TreeNode $TreeViewInterface $Type "[$($Type.FullName)]" + } + Else + { + IF ($I -EQ 0) + { + $Type=$Object.GetType() + Add-TreeNode $TreeViewInterface $Type "[$($Type.FullName)]" + } + } + } + } +# If ($mnuCaptureTypes.Checked) +# { +# Add-PSTypeNames $Object +# } + } + Else + { + #$StatusBar.Text = $Object.GetType().FullName + } + } + } + Catch [System.Exception] + { + Write-Verbose "TreeView_AfterSelect Catch" + Write-Error $_.Exception.Message + } +} + +#Event Handler for the form event Load +Function Form_Load +{ + [CmdletBinding()] + param ( + ) + Write-Verbose "Form_Load" + Get-PSObjectExplorerProfile +} + +#Event Handler for the form event Resize +Function Form_Resize +{ + [CmdletBinding()] + param ( + ) + Write-Verbose "Form_Resize" +} + +#endregion +#region Menu events + +#Event Handler for the Exit Menu event Click +Function mnuExit_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuExit_Click" + $Form.Close() + } + Catch [System.Exception] + { + Write-Verbose "mnuExit_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View WMI Objects event Click +Function mnuWMIObjects_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuWMIObjects_Click" + $mnuWMIObjects.Checked = ! $mnuWMIObjects.Checked + IF ($mnuWMIObjects.Checked) + { + Add-WMITreeNodes $TreeViewInstance + } + Else + { + IF ($Script:WMIRootNode) + { + Remove-TreeNode $Script:WMIRootNode + $Script:WMIClasses=$Null + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuWMIObjects_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View Net Assemblies event Click +Function mnuNetAssemblies_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuNetAssemblies_Click" + $mnuNetAssemblies.Checked = ! $mnuNetAssemblies.Checked + IF ($mnuNetAssemblies.Checked) + { + $NetAssembliesNode = Add-NetAssembliesNode $TreeViewInstance + $Script:POETreeNodes.Add("NetAssemblies",$NetAssembliesNode) + } + Else + { + $NetAssembliesNode = $Script:POETreeNodes["NetAssemblies"] + IF ($NetAssembliesNode -NE $Null) + { + Remove-TreeNode $NetAssembliesNode + $Script:POETreeNodes.Remove("NetAssemblies") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuWMIObjects_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View Net Classes event Click +Function mnuNetClasses_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuNetClasses_Click" + $mnuNetClasses.Checked = ! $mnuNetClasses.Checked + IF ($mnuNetClasses.Checked) + { + $NetClassesNode = Add-NetClassesNode $TreeViewInstance + $Script:POETreeNodes.Add("NetClasses",$NetClassesNode) + $TimerNetClasses.Enabled = $True + } + Else + { + $NetClassesNode = $Script:POETreeNodes["NetClasses"] + IF ($NetClassesNode -NE $Null) + { + Remove-TreeNode $NetClassesNode + $Script:POETreeNodes.Remove("NetClasses") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuNetClasses_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View PS Aliases event Click +Function mnuPSAliases_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuPSAliases_Click" + $mnuPSAliases.Checked = ! $mnuPSAliases.Checked + IF ($mnuPSAliases.Checked) + { + $PSAliasesNode = Add-PSAliasesNode $TreeViewInstance + $Script:POETreeNodes.Add("PSAliases",$PSAliasesNode) + } + Else + { + $PSAliasesNode = $Script:POETreeNodes["PSAliases"] + IF ($PSAliasesNode -NE $Null) + { + Remove-TreeNode $PSAliasesNode + $Script:POETreeNodes.Remove("PSAliases") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuPSAliases_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View PS Commands event Click +Function mnuPSCommands_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuPSCommands_Click" + $mnuPSCommands.Checked = ! $mnuPSCommands.Checked + IF ($mnuPSCommands.Checked) + { + $PSCommandsNode = Add-PSCommandsNode $TreeViewInstance + $Script:POETreeNodes.Add("PSCommands",$PSCommandsNode) + } + Else + { + $PSCommandsNode = $Script:POETreeNodes["PSCommands"] + IF ($PSCommandsNode -NE $Null) + { + Remove-TreeNode $PSCommandsNode + $Script:POETreeNodes.Remove("PSCommands") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuPSCommands_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View PS Drives event Click +Function mnuPSDrives_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuPSDrives_Click" + $mnuPSDrives.Checked = ! $mnuPSDrives.Checked + IF ($mnuPSDrives.Checked) + { + $PSDrivesNode = Add-PSDrivesNode $TreeViewInstance + $Script:POETreeNodes.Add("PSDrives",$PSDrivesNode) + } + Else + { + $PSDrivesNode = $Script:POETreeNodes["PSDrives"] + IF ($PSDrivesNode -NE $Null) + { + Remove-TreeNode $PSDrivesNode + $Script:POETreeNodes.Remove("PSDrives") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuPSDrives_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View PS Modules event Click +Function mnuPSModules_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuPSModules_Click" + $mnuPSModules.Checked = ! $mnuPSModules.Checked + IF ($mnuPSModules.Checked) + { + $PSModulesNode = Add-PSModulesNode $TreeViewInstance + $Script:POETreeNodes.Add("PSModules",$PSModulesNode) + } + Else + { + $PSModulesNode = $Script:POETreeNodes["PSModules"] + IF ($PSModulesNode -NE $Null) + { + Remove-TreeNode $PSModulesNode + $Script:POETreeNodes.Remove("PSModules") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuPSModules_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View PS Variables event Click +Function mnuPSVariables_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuPSVariables_Click" + $mnuPSVariables.Checked = ! $mnuPSVariables.Checked + IF ($mnuPSVariables.Checked) + { + $PSVariablesNode = Add-PSVariablesNode $TreeViewInstance + $Script:POETreeNodes.Add("PSVariables",$PSVariablesNode) + } + Else + { + $PSVariablesNode = $Script:POETreeNodes["PSVariables"] + IF ($PSVariablesNode -NE $Null) + { + Remove-TreeNode $PSVariablesNode + $Script:POETreeNodes.Remove("PSVariables") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuPSVariables_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View WIN Features event Click +Function mnuWINFeature_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuWINFeature_Click" + $mnuWINFeature.Checked = ! $mnuWINFeature.Checked + IF ($mnuWINFeature.Checked) + { + $WINFeatureNode = Add-WINFeaturesNode $TreeViewInstance + $Script:POETreeNodes.Add("WINFeatures",$WINFeatureNode) + } + Else + { + $WINFeatureNode = $Script:POETreeNodes["WINFeatures"] + IF ($WINFeatureNode -NE $Null) + { + Remove-TreeNode $WINFeatureNode + $Script:POETreeNodes.Remove("WINFeatures") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuWINFeature_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View WIN Processes event Click +Function mnuWINProcess_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuWINProcess_Click" + $mnuWINProcess.Checked = ! $mnuWINProcess.Checked + IF ($mnuWINProcess.Checked) + { + $WINProcessNode = Add-WINProcessesNode $TreeViewInstance + $Script:POETreeNodes.Add("WINProcesses",$WINProcessNode) + } + Else + { + $WINProcessNode = $Script:POETreeNodes["WINProcesses"] + IF ($WINProcessNode -NE $Null) + { + Remove-TreeNode $WINProcessNode + $Script:POETreeNodes.Remove("WINProcesses") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuWINProcess_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View WIN Services event Click +Function mnuWINService_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuWINService_Click" + $mnuWINService.Checked = ! $mnuWINService.Checked + IF ($mnuWINService.Checked) + { + $WINServiceNode = Add-WINServicesNode $TreeViewInstance + $Script:POETreeNodes.Add("WINServices",$WINServiceNode) + } + Else + { + $WINServiceNode = $Script:POETreeNodes["WINServices"] + IF ($WINServiceNode -NE $Null) + { + Remove-TreeNode $WINServiceNode + $Script:POETreeNodes.Remove("WINServices") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuWINService_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the View Test Cases event Click +Function mnuTestCases_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuTestCases_Click" + $mnuTestCases.Checked = ! $mnuTestCases.Checked + IF ($mnuTestCases.Checked) + { + $TestCasesNode = Add-TestCaseNodes $TreeViewInstance + $Script:POETreeNodes.Add("POETestCases",$TestCasesNode) + } + Else + { + $TestCasesNode = $Script:POETreeNodes["POEtestCases"] + IF ($TestCasesNode -NE $Null) + { + Remove-TreeNode $TestCasesNode + $Script:POETreeNodes.Remove("POETestCases") + } + } + } + Catch [System.Exception] + { + Write-Verbose "mnuTestCases_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the Options Show Objects event Click +Function mnuObjects_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuObjects_Click" + $mnuObjects.Checked = ! $mnuObjects.Checked + } + Catch [System.Exception] + { + Write-Verbose "mnuObjects_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the Options Show Structs event Click +Function mnuStructs_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuStructs_Click" + $mnuStructs.Checked = ! $mnuStructs.Checked + } + Catch [System.Exception] + { + Write-Verbose "mnuStructs_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the Options Show Collections event Click +Function mnuCollections_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuCollections_Click" + $mnuCollections.Checked = ! $mnuCollections.Checked + } + Catch [System.Exception] + { + Write-Verbose "mnuCollections_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the Options Show Nulls event Click +Function mnuNulls_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuNulls_Click" + $mnuNulls.Checked = ! $mnuNulls.Checked + } + Catch [System.Exception] + { + Write-Verbose "mnuNulls_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the Options Show Empty Strings event Click +Function mnuEmptyStrings_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuEmptyStrings_Click" + $mnuEmptyStrings.Checked = ! $mnuEmptyStrings.Checked + } + Catch [System.Exception] + { + Write-Verbose "mnuEmptyStrings_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#Event Handler for the Help About event Click +Function mnuAbout_Click +{ + [CmdletBinding()] + param () + Try + { + Write-Verbose "mnuExit_Click" + [System.Windows.Forms.MessageBox]::Show("PowerShell Object Explorer`n`nBy Brian Nadjiwon","PowerShell Object Explorer") + } + Catch [System.Exception] + { + Write-Verbose "mnuExit_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +Function TimerNetClasses_Tick +{ + [CmdletBinding()] + param () + Try + { + Write-Debug "TimerNetClasses_Tick" + $TimerNetClasses.Enabled=$False + $NetClassIndex = $Script:POETreeNodes["NetClassIndex"] + $NetAssembliesToProcess = $Script:POETreeNodes["NetAssembliesToProcess"] + Add-SomeNetClasses $NetClassIndex + $NetClassIndex++ + $Script:POETreeNodes["NetClassIndex"]=$NetClassIndex + $mnuStatus.Text="Loading Class $NetClassIndex" + IF ($NetAssembliesToProcess.Count -GT 0) + { + $TimerNetClasses.Enabled = $True + } + Else + { + $mnuStatus.Text="" + $Script:POETreeNodes.Remove("NetClassesList") + $Script:POETreeNodes.Remove("NetClassIndex") + $Script:POETreeNodes.Remove("NetClassesProcessed") + $Script:POETreeNodes.Remove("NetAssemblyClasses") + $Script:POETreeNodes.Remove("NetAssemblyMaxClasses") + $Script:POETreeNodes.Remove("NetAssembliesToProcess") + } + } + Catch [System.Exception] + { + Write-Verbose "mnuExit_Click Catch" + Write-Verbose $_.Exception.Message + } +} + +#endregion + +#Generates the form for PSObjectExplorer +Function Generate-PSObjectExplorerForm +{ + [CmdletBinding()] + param () + +Write-Verbose "Generate-Form" +$Form = New-Object System.Windows.Forms.Form +$MainMenu = New-Object System.Windows.Forms.MainMenu +$mnuFile = New-Object System.Windows.Forms.MenuItem +$mnuExit = New-Object System.Windows.Forms.MenuItem +$mnuView = New-Object System.Windows.Forms.MenuItem +$mnuWMIObjects = New-Object System.Windows.Forms.MenuItem +$mnuSeparatorV1 = New-Object System.Windows.Forms.MenuItem +$mnuNetAssemblies = New-Object System.Windows.Forms.MenuItem +$mnuNetClasses = New-Object System.Windows.Forms.MenuItem +$mnuSeparatorV2= New-Object System.Windows.Forms.MenuItem +$mnuPSAliases = New-Object System.Windows.Forms.MenuItem +$mnuPSCommands = New-Object System.Windows.Forms.MenuItem +$mnuPSDrives = New-Object System.Windows.Forms.MenuItem +$mnuPSModules = New-Object System.Windows.Forms.MenuItem +$mnuPSVariables = New-Object System.Windows.Forms.MenuItem +$mnuSeparatorV3= New-Object System.Windows.Forms.MenuItem +$mnuWINFeature = New-Object System.Windows.Forms.MenuItem +$mnuSeparatorV4= New-Object System.Windows.Forms.MenuItem +$mnuWINProcess = New-Object System.Windows.Forms.MenuItem +$mnuWINService = New-Object System.Windows.Forms.MenuItem +$mnuSeparatorV5= New-Object System.Windows.Forms.MenuItem +$mnuTestCases = New-Object System.Windows.Forms.MenuItem +$mnuOptions = New-Object System.Windows.Forms.MenuItem +$mnuObjects = New-Object System.Windows.Forms.MenuItem +$mnuStructs = New-Object System.Windows.Forms.MenuItem +$mnuSeparator4= New-Object System.Windows.Forms.MenuItem +$mnuCollections = New-Object System.Windows.Forms.MenuItem +$mnuSeparator5= New-Object System.Windows.Forms.MenuItem +$mnuNulls = New-Object System.Windows.Forms.MenuItem +$mnuEmptyStrings = New-Object System.Windows.Forms.MenuItem +$mnuSeparator6= New-Object System.Windows.Forms.MenuItem +$mnuHelp = New-Object System.Windows.Forms.MenuItem +$mnuAbout = New-Object System.Windows.Forms.MenuItem +$mnuStatus = New-Object System.Windows.Forms.MenuItem +$SplitContainerInstance = New-Object System.Windows.Forms.SplitContainer +$StatusBarInstance = New-Object System.Windows.Forms.StatusBar +$TreeViewInstance = New-Object System.Windows.Forms.TreeView +$TabControl = New-Object System.Windows.Forms.TabControl +$TabPageInstance = New-Object System.Windows.Forms.TabPage +$ListViewInstance = New-Object System.Windows.Forms.ListView +$TabPageClass = New-Object System.Windows.Forms.TabPage +$ListViewClass = New-Object System.Windows.Forms.ListView +$TabPageInterface = New-Object System.Windows.Forms.TabPage +$SplitContainerInterface = New-Object System.Windows.Forms.SplitContainer +$TreeViewInterface = New-Object System.Windows.Forms.TreeView +$ListViewInterface = New-Object System.Windows.Forms.ListView +$StatusBarInterface = New-Object System.Windows.Forms.StatusBar +$TabPagePSObject = New-Object System.Windows.Forms.TabPage +$TextBoxPSObject = New-Object System.Windows.Forms.TextBox +$TabPageValues = New-Object System.Windows.Forms.TabPage +$TextBoxValues = New-Object System.Windows.Forms.TextBox +$TabPagePowerShell = New-Object System.Windows.Forms.TabPage +$SplitContainerPowerShell = New-Object System.Windows.Forms.SplitContainer +$TextBoxPowerShell = New-Object System.Windows.Forms.TextBox +$ButtonExecute = New-Object System.Windows.Forms.Button +$TextBoxOutput = New-Object System.Windows.Forms.TextBox +$ButtonClear = New-Object System.Windows.Forms.Button +$TabPageWMIClasses = New-Object System.Windows.Forms.TabPage +$LabelComputers = New-Object System.Windows.Forms.Label +$TextBoxComputers = New-Object System.Windows.Forms.TextBox +$LabelFilter = New-Object System.Windows.Forms.Label +$TextBoxFilter = New-Object System.Windows.Forms.TextBox +$TimerNetClasses = New-Object System.Windows.Forms.Timer + +Write-Verbose "Generate-Form Form" +$Form.Name = 'Form' +$Form.Text = 'Powershell Object Explorer' +$Form.DataBindings.DefaultDataSourceUpdateMode = 0 +$Form.ClientSize = New-Object System.Drawing.Size(890,359) +$Form.StartPosition = 1 +$Form.BackColor = [System.Drawing.Color]::FromArgb(255,185,209,234) + +$Form.Add_Load({Form_Load}) +$Form.Add_FormClosing({$TimerNetClasses.Enabled=$False}) +$Form.Add_Resize({Form_Resize}) + +Write-Verbose "Generate-Form Menus" + +$MainMenu.Name = "MainMenu" +$Form.Menu = $MainMenu + +$mnuFile.Name = 'mnuFile' +$mnuFile.Text = '&File' +$MainMenu.MenuItems.Add($mnuFile) | Out-Null + +$mnuExit.Name = 'mnuExit' +$mnuExit.Text = 'E&xit' +$mnuExit.Add_Click({mnuExit_Click}) +$mnuFile.MenuItems.Add($mnuExit) | Out-Null + +$mnuView.Name = 'mnuView' +$mnuView.Text = '&View' +$MainMenu.MenuItems.Add($mnuView) | Out-Null + +$mnuWMIObjects.Name = 'mnuWMIObjects' +$mnuWMIObjects.Text = '&WMI Objects' +$mnuWMIObjects.Add_Click({mnuWMIObjects_Click}) +$mnuView.MenuItems.Add($mnuWMIObjects) | Out-Null + +$mnuSeparatorV1.Name = 'mnuSeparatorV1' +$mnuSeparatorV1.Text = '-' +$mnuView.MenuItems.Add($mnuSeparatorV1) | Out-Null + +$mnuNetAssemblies.Name = 'mnuNetAssemblies' +$mnuNetAssemblies.Text = '.Net Assemblies' +$mnuNetAssemblies.Add_Click({mnuNetAssemblies_Click}) +$mnuView.MenuItems.Add($mnuNetAssemblies) | Out-Null + +$mnuNetClasses.Name = 'mnuNetClasses' +$mnuNetClasses.Text = '.Net Classes' +$mnuNetClasses.Add_Click({mnuNetClasses_Click}) +$mnuView.MenuItems.Add($mnuNetClasses) | Out-Null + +$mnuSeparatorV2.Name = 'mnuSeparatorV2' +$mnuSeparatorV2.Text = '-' +$mnuView.MenuItems.Add($mnuSeparatorV2) | Out-Null + +$mnuPSAliases.Name = 'mnuPSAliases' +$mnuPSAliases.Text = 'PowerShell &Aliases' +$mnuPSAliases.Add_Click({mnuPSAliases_Click}) +$mnuView.MenuItems.Add($mnuPSAliases) | Out-Null + +$mnuPSCommands.Name = 'mnuPSCommands' +$mnuPSCommands.Text = 'PowerShell &Commands' +$mnuPSCommands.Add_Click({mnuPSCommands_Click}) +$mnuView.MenuItems.Add($mnuPSCommands) | Out-Null + +$mnuPSDrives.Name = 'mnuPSDrives' +$mnuPSDrives.Text = 'PowerShell &Drives' +$mnuPSDrives.Add_Click({mnuPSDrives_Click}) +$mnuView.MenuItems.Add($mnuPSDrives) | Out-Null + +$mnuPSModules.Name = 'mnuPSModules' +$mnuPSModules.Text = 'PowerShell &Modules' +$mnuPSModules.Add_Click({mnuPSModules_Click}) +$mnuView.MenuItems.Add($mnuPSModules) | Out-Null + +$mnuPSVariables.Name = 'mnuPSVariables' +$mnuPSVariables.Text = 'PowerShell &Variables' +$mnuPSVariables.Add_Click({mnuPSVariables_Click}) +$mnuView.MenuItems.Add($mnuPSVariables) | Out-Null + +$mnuSeparatorV3.Name = 'mnuSeparatorV3' +$mnuSeparatorV3.Text = '-' +$mnuView.MenuItems.Add($mnuSeparatorV3) | Out-Null + +$mnuWINFeature.Name = 'mnuWINFeature' +$mnuWINFeature.Text = 'Windows &Features' +$mnuWINFeature.Add_Click({mnuWINFeature_Click}) +$mnuView.MenuItems.Add($mnuWINFeature) | Out-Null + +$mnuSeparatorV4.Name = 'mnuSeparatorV4' +$mnuSeparatorV4.Text = '-' +$mnuView.MenuItems.Add($mnuSeparatorV4) | Out-Null + +$mnuWINProcess.Name = 'mnuWINProcess' +$mnuWINProcess.Text = 'Windows &Processes' +$mnuWINProcess.Add_Click({mnuWINProcess_Click}) +$mnuView.MenuItems.Add($mnuWINProcess) | Out-Null + +$mnuWINService.Name = 'mnuWINService' +$mnuWINService.Text = 'Windows &Services' +$mnuWINService.Add_Click({mnuWINService_Click}) +$mnuView.MenuItems.Add($mnuWINService) | Out-Null + +$mnuSeparatorV5.Name = 'mnuSeparatorV5' +$mnuSeparatorV5.Text = '-' +$mnuView.MenuItems.Add($mnuSeparatorV5) | Out-Null + +$mnuTestCases.Name = 'mnuTestCases' +$mnuTestCases.Text = 'Test Cases' +$mnuTestCases.Add_Click({mnuTestCases_Click}) +$mnuView.MenuItems.Add($mnuTestCases) | Out-Null + +$mnuOptions.Name = 'mnuOptions' +$mnuOptions.Text = '&Options' +$MainMenu.MenuItems.Add($mnuOptions) | Out-Null + +$mnuObjects.Name = 'mnuObjects' +$mnuObjects.Text = '&Show Objects' +$mnuObjects.Add_Click({mnuObjects_Click}) +$mnuOptions.MenuItems.Add($mnuObjects) | Out-Null + +$mnuStructs.Name = 'mnuStructs' +$mnuStructs.Text = 'Show St&ructs' +$mnuStructs.Add_Click({mnuStructs_Click}) +$mnuOptions.MenuItems.Add($mnuStructs) | Out-Null + +$mnuSeparator4.Name = 'mnuSeparator4' +$mnuSeparator4.Text = '-' +$mnuOptions.MenuItems.Add($mnuSeparator4) | Out-Null + +$mnuCollections.Name = 'mnuCollections' +$mnuCollections.Text = 'Show &Collections' +$mnuCollections.Add_Click({mnuCollections_Click}) +$mnuOptions.MenuItems.Add($mnuCollections) | Out-Null + +$mnuSeparator5.Name = 'mnuSeparator5' +$mnuSeparator5.Text = '-' +$mnuOptions.MenuItems.Add($mnuSeparator5) | Out-Null + +$mnuNulls.Name = 'mnuNulls' +$mnuNulls.Text = 'Show &Nulls' +$mnuNulls.Add_Click({mnuNulls_Click}) +$mnuOptions.MenuItems.Add($mnuNulls) | Out-Null + +$mnuEmptyStrings.Name = 'mnuEmptyStrings' +$mnuEmptyStrings.Text = 'Show &Empty Strings' +$mnuEmptyStrings.Add_Click({mnuEmptyStrings_Click}) +$mnuOptions.MenuItems.Add($mnuEmptyStrings) | Out-Null + +$mnuHelp.Name = 'mnuHelp' +$mnuHelp.Text = '&Help' +$MainMenu.MenuItems.Add($mnuHelp) | Out-Null + +$mnuAbout.Name = 'mnuAbout' +$mnuAbout.Text = '&About' +$mnuAbout.Add_Click({mnuAbout_Click}) +$mnuHelp.MenuItems.Add($mnuAbout) | Out-Null + +$mnuStatus.Name = 'mnuStatus' +$mnuStatus.Text = '' +$MainMenu.MenuItems.Add($mnuStatus) | Out-Null + +Write-Verbose "Generate-Form Computer SplitContainer" + +$SplitContainerInstance.Dock = [System.Windows.Forms.DockStyle]::Fill +$SplitContainerInstance.Location = New-Object System.Drawing.Point(0, 0) +$SplitContainerInstance.TabIndex = 0 +$SplitContainerInstance.Name = "SplitContainer" +$SplitContainerInstance.Text = "SplitContainer" +$SplitContainerInstance.Panel1.Controls.Add($TreeViewInstance) +$SplitContainerInstance.Panel2.Controls.Add($TabControl) + +$SplitContainerInstance.Add_SplitterMoved({SplitContainer_SplitterMoved $SplitContainerInstance $_}) + +$Form.Controls.Add($SplitContainerInstance) + +Write-Verbose "Generate-Form StatusBarInstance" + +$StatusBarInstance.Name = 'StatusBarInstance' +$StatusBarInstance.DataBindings.DefaultDataSourceUpdateMode = 0 +$StatusBarInstance.TabIndex = 8 +$StatusBarInstance.Size = New-Object System.Drawing.Size(428,22) +$StatusBarInstance.Location = New-Object System.Drawing.Point(0,337) +$StatusBarInstance.Text = 'Ready' + +$Form.Controls.Add($StatusBarInstance) + +#$Form.Controls.Add($TextBoxFilter) + +Write-Verbose "Generate-Form TreeViewInstance" + +$TreeViewInstance.Name = "TreeViewInstance" +$TreeViewInstance.TabIndex = 0 +$TreeViewInstance.Anchor = 15 +$TreeViewInstance.Dock = [System.Windows.Forms.DockStyle]::Fill +$TreeViewInstance.HideSelection = $False +$TreeViewInstance.Tag = $ListViewInstance + +$TreeViewInstance.Add_AfterSelect({TreeView_AfterSelect -Sender $TreeViewInstance -EventArg $_}) + +Write-Verbose "Generate-Form TabControl" + +$TabControl.Name = "TabControl" +$TabControl.TabIndex = 9 +$TabControl.Anchor = 15 +$TabControl.Dock = [System.Windows.Forms.DockStyle]::Fill + +#$Form.Controls.Add($TabControl) + +Write-Verbose "Generate-Form TabPage Instance" + +$TabPageInstance.Name = "TabPageInstance" +$TabPageInstance.Text = "Instance" +$TabPageInstance.TabIndex = 0 +$TabPageInstance.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabControl.Controls.Add($TabPageInstance) + +Write-Verbose "Generate-Form ListViewInstance" + +$ListViewInstance.Name = "ListViewInstance" +$ListViewInstance.TabIndex = 1 +$ListViewInstance.Dock = [System.Windows.Forms.DockStyle]::Fill +$ListViewInstance.Tag = $StatusBarInstance + + +$TabPageInstance.Controls.Add($ListViewInstance) + +Write-Verbose "Generate-Form TabPage Class" + +$TabPageClass.Name = "TabPageClass" +$TabPageClass.Text = "Class" +$TabPageClass.TabIndex = 0 +$TabPageClass.Anchor = 15 +$TabPageClass.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabControl.Controls.Add($TabPageClass) + +Write-Verbose "Generate-Form ListViewClass" + +$ListViewClass.Name = "ListViewClass" +$ListViewClass.TabIndex = 11 +$ListViewClass.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabPageClass.Controls.Add($ListViewClass) + +Write-Verbose "Generate-Form TabPage Interface" + +$TabPageInterface.Name = "TabPageInterface" +$TabPageInterface.Text = "Interface" +$TabPageInterface.TabIndex = 0 +$TabPageInterface.Anchor = 15 +$TabPageInterface.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabControl.Controls.Add($TabPageInterface) + +Write-Verbose "Generate-Form SplitContainerInterface" + +$SplitContainerInterface.Name = "SplitContainerInterface" +$SplitContainerInterface.Text = "SplitContainerInterface" +$SplitContainerInterface.Dock = [System.Windows.Forms.DockStyle]::Fill +#$SplitContainerInterface.SplitterDistance = 211 +$SplitContainerInterface.TabIndex = 0 + +$SplitContainerInterface.Panel1.Controls.Add($TreeViewInterface) +$SplitContainerInterface.Panel2.Controls.Add($ListViewInterface) + +$SplitContainerInterface.Add_SplitterMoved({SplitContainer_SplitterMoved $SplitContainerInterface $_}) + +$TabPageInterface.Controls.Add($SplitContainerInterface) + +$StatusBarInterface.Name = 'StatusBarInterface' +$StatusBarInterface.DataBindings.DefaultDataSourceUpdateMode = 0 +$StatusBarInterface.TabIndex = 8 +$StatusBarInterface.Size = New-Object System.Drawing.Size(428,22) +$StatusBarInterface.Location = New-Object System.Drawing.Point(0,337) +$StatusBarInterface.Text = 'StatusBarTabControl' + +$TabPageInterface.Controls.Add($StatusBarInterface) + + +Write-Verbose "Generate-Form TreeViewInstance" + +$TreeViewInterface.Name = "TreeViewInterface" +$TreeViewInterface.TabIndex = 0 +$TreeViewInterface.Dock = [System.Windows.Forms.DockStyle]::Fill +$TreeViewInterface.HideSelection = $False +$TreeViewInterface.Tag = $ListViewInterface + +$TreeViewInterface.Add_AfterSelect({TreeView_AfterSelect -Sender $TreeViewInterface -EventArg $_}) + +Write-Verbose "Generate-Form ListViewInterface" + +$ListViewInterface.Name = "ListViewInterface" +$ListViewInterface.TabIndex = 11 +$ListViewInterface.Dock = [System.Windows.Forms.DockStyle]::Fill +$ListViewInterface.Tag = $StatusBarInterface + + +Write-Verbose "Generate-Form TabPage PSObject" + +$TabPagePSObject.Name = "TabPagePSObject" +$TabPagePSObject.Text = "PSObject" +$TabPagePSObject.TabIndex = 0 +$TabPagePSObject.Anchor = 15 +$TabPagePSObject.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabControl.Controls.Add($TabPagePSObject) + +Write-Verbose "Generate-Form txtPSObject" + +$TextBoxPSObject.Text = '' +$TextBoxPSObject.Name = 'TextBoxPSObject' +$TextBoxPSObject.TabIndex = 15 +$TextBoxPSObject.MultiLine = $True +$TextBoxPSObject.WordWrap = $False +$TextBoxPSObject.ScrollBars = [System.Windows.Forms.ScrollBars]::Both +$TextBoxPSObject.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabPagePSObject.Controls.Add($TextBoxPSObject) + +Write-Verbose "Generate-Form TabPage Values" + +$TabPageValues.Name = "TabPageValues" +$TabPageValues.Text = "Values" +$TabPageValues.TabIndex = 0 +$TabPageValues.Anchor = 15 +$TabPageValues.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabControl.Controls.Add($TabPageValues) + +Write-Verbose "Generate-Form txtValues" + +$TextBoxValues.Text = '' +$TextBoxValues.Name = 'TextBoxValues' +$TextBoxValues.TabIndex = 15 +$TextBoxValues.MultiLine = $True +$TextBoxValues.WordWrap = $False +$TextBoxValues.ScrollBars = [System.Windows.Forms.ScrollBars]::Both +$TextBoxValues.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabPageValues.Controls.Add($TextBoxValues) + +Write-Verbose "Generate-Form TabPage PowerShell" + +$TabPagePowerShell.Name = "TabPagePowerShell" +$TabPagePowerShell.Text = "PowerShell" +$TabPagePowerShell.TabIndex = 0 +$TabPagePowerShell.Anchor = 15 +$TabPagePowerShell.Dock = [System.Windows.Forms.DockStyle]::Fill + +$TabControl.Controls.Add($TabPagePowerShell) + +Write-Verbose "Generate-Form SplitContainerPowerShell" + +$SplitContainerPowerShell.Name = "SplitContainerPowerShell" +$SplitContainerPowerShell.Text = "SplitContainerPowerShell" +$SplitContainerPowerShell.Dock = [System.Windows.Forms.DockStyle]::Fill +#$SplitContainerPowerShell.SplitterDistance = 211 +$SplitContainerPowerShell.Orientation = [System.Windows.Forms.Orientation]::Horizontal + +$SplitContainerPowerShell.Panel1.Controls.Add($TextboxPowerShell) +$SplitContainerPowerShell.Panel1.Controls.Add($ButtonExecute) +$SplitContainerPowerShell.Panel2.Controls.Add($TextboxOutput) +$SplitContainerPowerShell.Panel2.Controls.Add($ButtonClear) + +$SplitContainerPowerShell.Add_SplitterMoved({SplitContainer_SplitterMoved $SplitContainerPowerShell $_}) + +$TabPagePowerShell.Controls.Add($SplitContainerPowerShell) + +Write-Verbose "Generate-Form txtPowerShell" + +$TextBoxPowerShell.Text = '' +$TextBoxPowerShell.Name = 'TextBoxPowerShell' +$TextBoxPowerShell.TabIndex = 15 +$TextBoxPowerShell.MultiLine = $True +$TextBoxPowerShell.WordWrap = $False +$TextBoxPowerShell.ScrollBars = [System.Windows.Forms.ScrollBars]::Both +$TextBoxPowerShell.Dock = [System.Windows.Forms.DockStyle]::Fill + +Write-Verbose "Generate-Form ButtonExecute" + +$ButtonExecute.Enabled = $True +$ButtonExecute.Name = "ButtonExecute" +$ButtonExecute.Location = New-Object System.Drawing.Point(40,10) +$ButtonExecute.Size = New-Object System.Drawing.Size(75, 23) +$ButtonExecute.TabIndex = 0 +$ButtonExecute.Text = "Execute" +$ButtonExecute.UseVisualStyleBackColor = $True +$ButtonExecute.Dock = [System.Windows.Forms.DockStyle]::Right +#$ButtonExecute.Add_Click({ButtonExecute_Click $ButtonExecute}) +$ButtonExecute.Add_Click({ + Try + { + Write-Verbose "ButtonExecute_Click" + $TextBoxOutput.Text + #$Output = $ExecutionContext.InvokeCommand.InvokeScript($TextBoxPowerShell.Text,$False,$Null,$Null) + $Output = $ExecutionContext.InvokeCommand.InvokeScript($TextBoxPowerShell.Text) + IF ($Output -NE "") + { + ForEach ($Line In $OutPut) + { + $TextBoxOutput.Text += "$Line `r`n" + } + } + } + Catch [System.Exception] + { + Write-Verbose "ButtonExecute_Click Catch" + Write-Error $_.Exception.Message + } +}) + +Write-Verbose "Generate-Form txtOutput" + +$TextBoxOutput.Text = '' +$TextBoxOutput.Name = 'TextBoxOutput' +$TextBoxOutput.TabIndex = 15 +$TextBoxOutput.MultiLine = $True +$TextBoxOutput.WordWrap = $False +$TextBoxOutput.ScrollBars = [System.Windows.Forms.ScrollBars]::Both +$TextBoxOutput.Dock = [System.Windows.Forms.DockStyle]::Fill + +Write-Verbose "Generate-Form ButtonClear" + +$ButtonClear.Enabled = $True +$ButtonClear.Name = "ButtonClear" +$ButtonClear.Location = New-Object System.Drawing.Point(40,10) +$ButtonClear.Size = New-Object System.Drawing.Size(75, 23) +$ButtonClear.TabIndex = 0 +$ButtonClear.Text = "Clear" +$ButtonClear.UseVisualStyleBackColor = $True +$ButtonClear.Dock = [System.Windows.Forms.DockStyle]::Right +$ButtonClear.Add_Click({$TextBoxOutput.Text = ""}) + +Write-Verbose "Generate-Form TabPage WMIClasses" + +$TabPageWMIClasses.Name = "TabPageWMIClasses" +$TabPageWMIClasses.Text = "WMI Classes" +$TabPageWMIClasses.TabIndex = 0 +$TabPageWMIClasses.Anchor = 15 +$TabPageWMIClasses.Dock = [System.Windows.Forms.DockStyle]::Fill +$TabControl.Controls.Add($TabPageWMIClasses) + +Write-Verbose "Generate-Form LabelComputers" + +$LabelComputers.Text = 'Computer' +$LabelComputers.Name = 'LabelComputers' +$LabelComputers.TabIndex = 12 +$LabelComputers.Size = New-Object System.Drawing.Size(60,20) +$LabelComputers.Location = New-Object System.Drawing.Point(1,25) +$LabelComputers.DataBindings.DefaultDataSourceUpdateMode = 0 + +$TabPageWMIClasses.Controls.Add($LabelComputers) + +Write-Verbose "Generate-Form TextBoxComputers" + +$TextBoxComputers.Text = 'Localhost' +$TextBoxComputers.Name = 'TextBoxComputerss' +$TextBoxComputers.TabIndex = 13 +$TextBoxComputers.Size = New-Object System.Drawing.Size(306,20) +$TextBoxComputers.Location = New-Object System.Drawing.Point(61,20) +$TextBoxComputers.DataBindings.DefaultDataSourceUpdateMode = 0 + +$TabPageWMIClasses.Controls.Add($TextBoxComputers) + +Write-Verbose "Generate-Form LabelFilter" + +$LabelFilter.Text = 'Filter' +$LabelFilter.Name = 'LabelFilter' +$LabelFilter.TabIndex = 14 +$LabelFilter.Size = New-Object System.Drawing.Size(60,20) +$LabelFilter.Location = New-Object System.Drawing.Point(1,50) +$LabelFilter.DataBindings.DefaultDataSourceUpdateMode = 0 + +$TabPageWMIClasses.Controls.Add($LabelFilter) + +Write-Verbose "Generate-Form TextBoxFilter" + +$TextBoxFilter.Text = '' +$TextBoxFilter.Name = 'TextBoxFilter' +$TextBoxFilter.TabIndex = 15 +$TextBoxFilter.Size = New-Object System.Drawing.Size(306,20) +$TextBoxFilter.Location = New-Object System.Drawing.Point(61,45) +$TextBoxFilter.DataBindings.DefaultDataSourceUpdateMode = 0 + +$TabPageWMIClasses.Controls.Add($TextBoxFilter) + +#$TimerNetClasses.Name = "TimerNetClasses" +$TimerNetClasses.Interval=100 +$TimerNetClasses.Add_Tick({TimerNetClasses_Tick}) + +#Show the Form +$Form.ShowDialog()| Out-Null +} + +#endregion + +# VerbosePreference= SilentlyContinue is the default +#$VerbosePreference="SilentlyContinue" + +# VerbosePreference= Continue will show verbose statements (useful for debugging) +#$VerbosePreference="Continue" + +# DebugPreference= SilentlyContinue is the default +#$DebugPreference="SilentlyContinue" + +# DebugPreference= Continue will show verbose statements (useful for debugging) +#$DebugPreference="Continue" + +#CLS +#$Error.Clear() + +Generate-PSObjectExplorerForm + diff --git a/App/Scripts/PowerCopy.ps1 b/Extensions/Tools/PowerCopy.ps1 similarity index 100% rename from App/Scripts/PowerCopy.ps1 rename to Extensions/Tools/PowerCopy.ps1 diff --git a/App/Scripts/Show-PSHelpTree.ps1 b/Extensions/Tools/Show-PSHelpTree.ps1 similarity index 100% rename from App/Scripts/Show-PSHelpTree.ps1 rename to Extensions/Tools/Show-PSHelpTree.ps1 diff --git a/App/Scripts/ThumbnailPhotoManager.ps1 b/Extensions/Tools/ThumbnailPhotoManager.ps1 similarity index 100% rename from App/Scripts/ThumbnailPhotoManager.ps1 rename to Extensions/Tools/ThumbnailPhotoManager.ps1 diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 9cecc1d..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/App/license.txt b/License.txt similarity index 96% rename from App/license.txt rename to License.txt index 6635df9..df039a0 100644 --- a/App/license.txt +++ b/License.txt @@ -1,40 +1,40 @@ -AdminMenu is a powershell driven WPF menu geared for IT professionals -Copyright (C) 2016 PowershellCrack.com. Richard Tracy - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Some Powershell script are included; most of them are from the -Microsoft Technet Gallery. Microsoft User license aggreement states: - -The MIT License (MIT) - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +AdminMenu is a powershell driven WPF menu geared for IT professionals +Copyright (C) 2016 PowershellCrack.com. Richard Tracy + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Some Powershell script are included; most of them are from the +Microsoft Technet Gallery. Microsoft User license aggreement states: + +The MIT License (MIT) + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index a18ff6d..95ac4c9 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,53 @@ -# Admin Run-As Menu -I developed a PowerShell driven Admin Utility menu (using the latest WPF technology and Mahapps theme) that is highly customizable. - -![Alt_text](http://4.bp.blogspot.com/-Qs89EvFyqd8/WC0siMzc03I/AAAAAAAAD90/_-CsNB0sZHUmspoOxROR9JMb8MrL6FpSgCK4B/s1600/adminmenu_creds.png) - -![Alt_text](http://2.bp.blogspot.com/-tYgUvZ8pMfE/WC0teSKRvWI/AAAAAAAAD-E/aV9tXaICpxgizd--Du6FKPwV7s3jgPqpwCK4B/s1600/adminmenu_tab2.png) - -![Alt_text](http://3.bp.blogspot.com/-dgWB7g6VSvU/WC0tjZ9WMyI/AAAAAAAAD-k/3R-a8ky_BF0aFIJSuNaII-sV09IAdOT7QCK4B/s1600/adminmenu_tab6.png) - - -# EULA -AdminMenu is a powershell driven WPF menu geared for IT professionals - -Copyright (C) 2016 PowershellCrack.com. Richard Tracy - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Some Powershell script are included; most of them are from the -Microsoft Technet Gallery. Microsoft User license aggreement states: - -The MIT License (MIT) - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - +# Admin Run-As Menu +I developed a PowerShell driven Admin Utility menu (using the latest WPF technology and Mahapps theme) that is highly customizable. + +![Alt_text](http://4.bp.blogspot.com/-Qs89EvFyqd8/WC0siMzc03I/AAAAAAAAD90/_-CsNB0sZHUmspoOxROR9JMb8MrL6FpSgCK4B/s1600/adminmenu_creds.png) + +![Alt_text](http://2.bp.blogspot.com/-tYgUvZ8pMfE/WC0teSKRvWI/AAAAAAAAD-E/aV9tXaICpxgizd--Du6FKPwV7s3jgPqpwCK4B/s1600/adminmenu_tab2.png) + +![Alt_text](http://3.bp.blogspot.com/-dgWB7g6VSvU/WC0tjZ9WMyI/AAAAAAAAD-k/3R-a8ky_BF0aFIJSuNaII-sV09IAdOT7QCK4B/s1600/adminmenu_tab6.png) + + +# EULA +AdminMenu is a powershell driven WPF menu geared for IT professionals + +Copyright (C) 2016 PowershellCrack.com. Richard Tracy + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Some Powershell script are included; most of them are from the +Microsoft Technet Gallery. Microsoft User license aggreement states: + +The MIT License (MIT) + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + diff --git a/App/Resources/About.xaml b/Resources/About.xaml similarity index 98% rename from App/Resources/About.xaml rename to Resources/About.xaml index 53c7eaf..8e99480 100644 --- a/App/Resources/About.xaml +++ b/Resources/About.xaml @@ -1,34 +1,34 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/App/Resources/AppHide-MahApps.xaml b/Resources/AppHide-MahApps.xaml similarity index 94% rename from App/Resources/AppHide-MahApps.xaml rename to Resources/AppHide-MahApps.xaml index 0355ea7..9bb1c9d 100644 --- a/App/Resources/AppHide-MahApps.xaml +++ b/Resources/AppHide-MahApps.xaml @@ -1,73 +1,74 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App/Resources/AppHide.xaml b/Resources/AppHide.xaml similarity index 96% rename from App/Resources/AppHide.xaml rename to Resources/AppHide.xaml index bb992d9..52b1f84 100644 --- a/App/Resources/AppHide.xaml +++ b/Resources/AppHide.xaml @@ -1,52 +1,52 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/App/Resources/AppOpen-MahApps.xaml b/Resources/AppOpen-MahApps.xaml similarity index 62% rename from App/Resources/AppOpen-MahApps.xaml rename to Resources/AppOpen-MahApps.xaml index 517adf5..49143ed 100644 --- a/App/Resources/AppOpen-MahApps.xaml +++ b/Resources/AppOpen-MahApps.xaml @@ -1,74 +1,75 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App/Resources/AppOpen.xaml b/Resources/AppOpen.xaml similarity index 98% rename from App/Resources/AppOpen.xaml rename to Resources/AppOpen.xaml index f05f912..97a6c90 100644 --- a/App/Resources/AppOpen.xaml +++ b/Resources/AppOpen.xaml @@ -1,53 +1,53 @@ - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/App/Resources/BureauBlue.xaml b/Resources/BureauBlue.xaml similarity index 98% rename from App/Resources/BureauBlue.xaml rename to Resources/BureauBlue.xaml index 10b0d71..9c67ee4 100644 --- a/App/Resources/BureauBlue.xaml +++ b/Resources/BureauBlue.xaml @@ -1,3837 +1,3837 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #FF000000 - #FFFFFFFF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #FF000000 + #FFFFFFFF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App/Resources/CredentialWindow.xaml b/Resources/CredentialWindow.xaml similarity index 98% rename from App/Resources/CredentialWindow.xaml rename to Resources/CredentialWindow.xaml index 7bf9d3e..4b1eae8 100644 --- a/App/Resources/CredentialWindow.xaml +++ b/Resources/CredentialWindow.xaml @@ -1,57 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -