ComplianceDiagnosticUtils.psm1


function Get-Button{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string] $ButtonName,

        [Parameter(Mandatory = $false)]
        [string] $Margin = "0,0,0,0",

        [Parameter(Mandatory = $false)]
        [int] $width=214,

        [Parameter(Mandatory = $false)]
        [int] $height = 46,

        [Parameter(Mandatory = $false)]
        [float] $fontSize = 15.0,

        [Parameter(Mandatory = $false)]
        [string] $FontFamily = "Microsoft Sans Serif",

        [Parameter(Mandatory = $false)]
        [string] $HorizontalAlignment = "Center",

        [Parameter(Mandatory = $false)]
        [string] $VerticalAlignment = "Center"

    )

    $button = New-Object Windows.Controls.Button
    $button.Content    = $ButtonName
    $button.width      = $width
    $button.height     = $height
    $button.FontFamily = New-Object Windows.Media.FontFamily($FontFamily)
    $button.Cursor     = [Windows.Input.Cursors]::Hand

    $rgbColor = [Windows.Media.Color]::FromRgb(63, 119, 206)
    $backgroundBrush = New-Object Windows.Media.SolidColorBrush($rgbColor)

    $button.Background = $backgroundBrush
    $button.Foreground = [Windows.Media.Brushes]::White
    $button.FontSize   = $fontSize
    $button.FontWeight   = [Windows.FontWeights]::Medium
    $button.Margin = $Margin
    $button.HorizontalAlignment = $HorizontalAlignment
    $button.VerticalAlignment = $VerticalAlignment
    $button.BorderThickness = 0
            
    return $button
}

function Get-FileAttachments() {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $false)]
        [string] $Multiselect = $true
    )


    $fileDialog = New-Object System.Windows.Forms.OpenFileDialog
    $fileDialog.Multiselect = $Multiselect
    $fileDialog.Filter = "All files (*.*)|*.*"
    $result = $fileDialog.ShowDialog()
    if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
        $filedata = [System.Collections.ArrayList]@()
        foreach ($file in $fileDialog.FileNames) {
            $fileObject = [PSCustomObject]@{
                Name = $file
                Content = ([System.IO.File]::ReadAllBytes($file))
            }
            $filedata.Add($fileObject) | Out-Null
        }
        return $filedata
    }
}


function Get-MSLogo(){

    # Importing MS image from the local downloaded Path
    $imagePath = Join-Path $PSScriptRoot 'Images\MSimage.png'

   # Create an Image for the TabItem header
    $imageControl = New-Object Windows.Controls.Image
   
    # Set the Image control's Source property
   
    $imageControl.Source = [Windows.Media.Imaging.BitmapImage]::new([System.Uri]::new($imagePath))

    # Set the header of the TabItem to the Image control
    # Create a Setter for the header
    $headerSetter = New-Object Windows.Setter
    $headerSetter.Property = [Windows.Controls.TabItem]::HeaderProperty
    $headerSetter.Value = $imageControl

    $disabledTabItemStyle = New-Object Windows.Style
    $disabledTabItemStyle.TargetType = [Windows.Controls.TabItem]

    # Customize the appearance of the disabled TabItem
    $disabledTabItemStyle.Setters.Add([Windows.Setter]::new([Windows.Controls.TabItem]::BackgroundProperty, [Windows.Media.Brushes]::Transparent)) > $null
    $disabledTabItemStyle.Setters.Add([Windows.Setter]::new([Windows.Controls.TabItem]::BorderBrushProperty, [Windows.Media.Brushes]::Transparent)) > $null
    $disabledTabItemStyle.Setters.Add([Windows.Setter]::new([Windows.Controls.TabItem]::BorderThicknessProperty, [Windows.Thickness]::new(0))) > $null
    $disabledTabItemStyle.Setters.Add([Windows.Setter]::new([Windows.Controls.TabItem]::ForegroundProperty, [Windows.Media.Brushes]::Transparent)) > $null

    # Create a Setter for the IsEnabled property of the TabItem
    $isEnabledSetter = New-Object Windows.Setter
    $isEnabledSetter.Property = [Windows.Controls.TabItem]::IsEnabledProperty
    $isEnabledSetter.Value = $False
    # $disabledTabItemStyle.Setters.Add($isEnabledSetter)
    $disabledTabItemStyle.Setters.Add($headerSetter) > $null

    # Create a TabItem with the custom style
    $MSLogo = New-Object Windows.Controls.TabItem
    $MSLogo.Height = 70
    $MSLogo.Width = 200
    $MSLogo.Padding = "10,20,10,20"
    $MSLogo.Style = $disabledTabItemStyle

    return $MSLogo
}

function Get-LeftTabControl(){
    $leftTabControl = New-Object Windows.Controls.TabControl
    $leftTabControl.TabStripPlacement = [Windows.Controls.Dock]::Left
    $global:ContextScopeVariables.leftTabControl = $leftTabControl

    $leftTabControl.Add_SelectionChanged({
        param (
            $sender,
            $eventArgs
        )

        if(!$global:ContextScopeVariables.previousTabIndex){
            $global:ContextScopeVariables.previousTabIndex = 1
        }

        $currentIndex = $sender.SelectedIndex
    
        if ($currentIndex -eq 0) {
            $global:ContextScopeVariables.leftTabControl.SelectedIndex  = $global:ContextScopeVariables.previousTabIndex
        }
        else{
            $global:ContextScopeVariables.previousTabIndex = $currentIndex
        }
    })

    return $leftTabControl
}

function Get-TabItem ($Name){
    $tabItem = New-Object Windows.Controls.TabItem
    $tabItem.Header = $Name
    $tabItem.Height = "35"
    $tabItem.FontSize = "14"
    $tabItem.Width= "200"
    return $tabItem
}

function Get-ExoCmdletResult {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true)]
        [powershell]$ps
    )

    $ps.Runspace = $global:EXOSession

    $handle = $ps.BeginInvoke()
    $result = $ps.EndInvoke($handle)
    $ps.Dispose()
    return $result
}


function LoginAndConnect {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $false)]
        [ValidateSet('O365Default','O365GermanyCloud','O365China','O365USGovGCCHigh', 'O365USGovDoD')]
        [string] $Environment = "O365Default"
    )
    $connections=Get-ConnectionInformation
    
    $rs=Get-Runspace
    $exch=$rs|?{$_.Name -eq "ExchangeRS" -and $_.RunspaceStateInfo.State -eq "Opened" -and $_.RunspaceAvailability -eq "Available"}
    $exoConnectionNeeded = $false
    
    if ($exch -eq $null)
    {
        $global:EXOSession = [runspacefactory]::CreateRunspace()
        $global:EXOSession.Name = "ExchangeRS"
        $global:EXOSession.Open()
        $exoConnectionNeeded = $true
    }
    else
    {
        $global:EXOSession = $exch
    }    
    
    $exoActiveConnections = $connections | ?{$_.State -eq "Connected" -and $_.IsEopSession -eq $false -and $_.TokenStatus -eq "Active"}
    if ($exoActiveConnections -eq $null -or $exoActiveConnections.Count -eq 0 -or $exoConnectionNeeded)
    {
        Write-Host "Connecting to ExchangeManagement Shell. Please check your login prompt."
        $scriptBlock = {
            param($Environment)
            Connect-ExchangeOnline -ExchangeEnvironmentName $Environment
        }
        $ps = [powershell]::Create().AddScript($scriptBlock)
        $ps.AddArgument($Environment) | Out-Null
        $result = Get-ExoCmdletResult -ps $ps
    }
    
    $eopActiveConnections = $connections| ?{$_.State -eq "Connected"  -and $_.TokenStatus -eq "Active"}
    $eopconnected=$false
        foreach($c in $eopActiveConnections)
        { 
             if($c.ConnectionUri -like "*compliance*")
             {
                $eopconnected = $true
                break
            }
        }

    if ($eopconnected -eq $false)
    {
        Write-Host "Connecting to Security & Compliance PowerShell. Please check your login prompt."
        switch ($Environment)
        {
            "O365China" {$ConnectionUri = "https://ps.compliance.protection.partner.outlook.cn/powershell-liveid"}
            "O365USGovGCCHigh" {$ConnectionUri = "https://ps.compliance.protection.office365.us/powershell-liveid/"}
            "O365USGovDoD" {$ConnectionUri = "https://l5.ps.compliance.protection.office365.us/powershell-liveid/"}
            default {$ConnectionUri = "https://ps.compliance.protection.outlook.com/powershell-liveid/"}
        }
        Connect-IPPSSession -ConnectionUri $ConnectionUri
    }
}

function Get-ToolTip{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string] $Text,

        [Parameter(Mandatory = $false)]
        [string] $linkText ,

        [Parameter(Mandatory = $false)]
        [string] $link

    )
    # Create a ToolTip for the TextBox
    $tooltip = New-Object Windows.Controls.ToolTip

    # Create a TextBlock for the tooltip content
    $tooltipContent = New-Object Windows.Controls.TextBlock

    # Add regular text to the tooltip
    $tooltipContent.Inlines.Add($Text)

    if($link){
        # Create a Hyperlink
        $hyperlink = New-Object Windows.Documents.Hyperlink
        if($linkText){
            $hyperlink.Inlines.Add($linkText)
        }
        else{
            $hyperlink.Inlines.Add($link)
        }
        $hyperlink.NavigateUri = $link
        $hyperlink.Add_Click({
            Start-Process $hyperlink.NavigateUri
        })

        # Add the Hyperlink to the TextBlock
        $tooltipContent.Inlines.Add($hyperlink)
    }

    # Set the content of the tooltip to the TextBlock
    $tooltip.Content = $tooltipContent

    return $tooltip
}

function Show-Text{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string] $Text,

        [Parameter(Mandatory = $false)]
        [bool] $IsBold = $false,

        [Parameter(Mandatory = $false)]
        [System.Windows.Media.Color] $Color,

        [Parameter(Mandatory = $false)]
        [string] $padding = "0,10,0,10",

        [Parameter(Mandatory = $false)]
        [string] $margin = "0,0,0,10",

        [Parameter(Mandatory = $false)]
        [string] $fontSize = 14,

        [Parameter(Mandatory = $false)]
        [string] $HorizontalAlignment = "Center",

        [Parameter(Mandatory = $false)]
        [string] $VerticalAlignment = "Center",

        [Parameter(Mandatory = $false)]
        [string] $Width,

        [Parameter(Mandatory = $false)]
        [bool] $ShowHelp = $false
    )


    $textArea = New-Object Windows.Controls.TextBlock
    $textArea.FontSize = $fontSize
    $textArea.Text = $text
    $textArea.Padding = $padding
    $textArea.Margin = $margin
    $textArea.HorizontalAlignment = $HorizontalAlignment
    $textArea.VerticalAlignment = $VerticalAlignment
    if($IsBold){
        $textArea.FontWeight = "Bold"
    }
    if($Color){
        $brush = [System.Windows.Media.SolidColorBrush]::new($Color)
        $textArea.Foreground = $brush
    }
    if($Width){
        $textArea.Width = $Width
    }
    if($ShowHelp){
        $imagePath = Join-Path $PSScriptRoot 'Images\help3.png'

        $image = New-Object Windows.Controls.Image
        $image.Source = [Windows.Media.Imaging.BitmapImage]::new([System.Uri]::new($imagePath))
        $run = New-Object Windows.Documents.Run
      
        $inlineUIContainer = New-Object Windows.Documents.InlineUIContainer
        $inlineUIContainer.Child = $image
        $textArea.Inlines.Add($run)
        $textArea.Inlines.Add($inlineUIContainer)
    }
    return $textArea
}

function Get-TextBox{
    param (
        [Parameter(Mandatory = $false)]
        [string] $Width,
        [Parameter(Mandatory = $false)]
        [string] $Height,
        [Parameter(Mandatory = $false)]
        [string] $FontSize,
        [Parameter(Mandatory = $false)]
        [string] $Margin,
        [Parameter(Mandatory = $false)]
        [string] $HorizontalAlignment = "Center",
        [Parameter(Mandatory = $false)]
        [string] $VerticalAlignment = "Center",
        [Parameter(Mandatory = $false)]
        [string] $Text,
        [Parameter(Mandatory = $false)]
        [bool] $IsReadOnly = $false
    )
    $textBox = New-Object Windows.Controls.TextBox
    $textBox.HorizontalAlignment = $HorizontalAlignment
    $textBox.VerticalAlignment = $VerticalAlignment
   # $textBox.VerticalAlignment = [Windows.VerticalAlignment]::Top
   # $textBox.Margin = New-Object Windows.Thickness(10, 10, 10, 10)
   if ($Width -ne "") {         $textBox.Width = $Width    }
    if ($Height -ne "") {        $textBox.Height = $Height    }
    if ($FontSize -ne "") {        $textBox.FontSize = $FontSize   }
    if ($Margin -ne "") {        $textBox.Margin = $Margin   }
    if ($Text -ne "") {        $textBox.Text = $Text   }
    if ($IsReadOnly) {        $textBox.IsReadOnly = $true   }

    return $textBox
}


function Get-ForestInfo(){
    if (!$global:ContextScopeVariables.forests){
        Write-Host "Getting forest details using connections and Org config"

        $connections=Get-ConnectionInformation
        
        $eopActiveConnections = $connections | ?{$_.State -eq "Connected" -and $_.TokenStatus -eq "Active"}
        foreach($c in $eopActiveConnections)
        { 
             if($c.ConnectionUri -like "*compliance*")
             {
                $global:ContextScopeVariables.forests=@{}
                $global:ContextScopeVariables.forests.eopForest = $c.ConnectionUri.Substring(8, 5)
                break
            }
        }

        $scriptBlock = {
            $command = Get-Command Get-OrganizationConfig -ErrorAction SilentlyContinue
            if ($command -eq $null) {
                return $null
            }
            $orgConfig = Get-OrganizationConfig
            return $orgConfig
        }
        $ps = [powershell]::Create().AddScript($scriptBlock)

        $orgConfig = Get-ExoCmdletResult -ps $ps

        if($orgConfig -ne $null)
        {
            $global:ContextScopeVariables.forests.exoForests = @($orgconfig.AllowedMailboxRegions | ForEach-Object {$_.Substring($_.IndexOf("=")+1)})
        }        
    }
   
}

function Get-DateTimePickerDialog{
  
    $global:mainForm = New-Object System.Windows.Forms.Form
    $global:mainForm.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen
    $global:mainForm.Text = "Pick Time Frame"
    $global:mainForm.Width = 300
    $global:mainForm.Height = 200

    # DatePicker Label
    $datePickerLabel = New-Object System.Windows.Forms.Label
    $datePickerLabel.Text = "Date"
    $datePickerLabel.Location = "15, 10"
    $datePickerLabel.Height = 22
    $datePickerLabel.Width = 90
    $global:mainForm.Controls.Add($datePickerLabel)

    # MinTimePicker Label
    $TimePickerLabel = New-Object System.Windows.Forms.Label
    $TimePickerLabel.Text = "Time"
    $TimePickerLabel.Location = "15, 45"
    $TimePickerLabel.Height = 22
    $TimePickerLabel.Width = 90
    $global:mainForm.Controls.Add($TimePickerLabel)

    $UTCLabel = New-Object System.Windows.Forms.Label
    $UTCLabel.Text = "UTC TIME ONLY"
    $titleFont = New-Object System.Drawing.Font("Arial", 9, [System.Drawing.FontStyle]::Bold)
    $UTCLabel.Font = $titleFont
    $UTCLabel.Location = "25, 75"
    $UTCLabel.Height = 30
    $UTCLabel.Width = 180
    $global:mainForm.Controls.Add($UTCLabel)

    # DatePicker
    $global:datePicker = New-Object System.Windows.Forms.DateTimePicker
    $global:datePicker.Location = "110, 7"
    $global:datePicker.Width = "150"
    $global:datePicker.Format = [windows.forms.datetimepickerFormat]::custom
    $global:datePicker.CustomFormat = "dd/MM/yyyy"
    $global:mainForm.Controls.Add($global:datePicker)

    # TimePicker
    $global:timePicker = New-Object System.Windows.Forms.DateTimePicker
    $global:timePicker.Location = "110, 42"
    $global:timePicker.Width = "150"
    $global:timePicker.Format = [windows.forms.datetimepickerFormat]::custom
    $global:timePicker.CustomFormat = "HH:mm:ss"
    $global:timePicker.ShowUpDown = $TRUE
    $global:mainForm.Controls.Add($global:timePicker)


    # OK Button
    $global:okButton = New-Object System.Windows.Forms.Button
    $global:okButton.Location = "95, 110"
    $global:okButton.ForeColor = "White"
    $global:okButton.BackColor = [System.Drawing.Color]::FromArgb(63, 119, 206)
    $global:okButton.Text = "OK"
    $global:mainForm.Controls.Add($global:okButton)
    $global:okButton.add_Click({
        
        $prop = $global:ContextScopeVariables.DateTimeProp 
        $globalScope=Get-Variable -Name "ContextScopeVariables" -Scope Global
        $globalScope.Value[$prop] = "$($global:datePicker.Text) $($global:timePicker.Text)"
        $globalScope.Value["$($prop)Label"].Text = "$($global:ContextScopeVariables[$prop]) UTC"
        $globalScope.Value["$($prop)Label"].Height = 40
        Set-Variable -Name "ContextScopeVariables" -Value $globalScope.Value -Scope Global
        $global:mainForm.close()
    })
    [void] $global:mainForm.ShowDialog()
    return $global:okButton
}

function Get-DropDown {
    param (
        [Parameter(Mandatory = $false)]
        [string] $Width,
        [Parameter(Mandatory = $false)]
        [string] $Height,
        [Parameter(Mandatory = $false)]
        [string] $FontSize,
        [Parameter(Mandatory = $false)]
        [string] $Margin,
        [Parameter(Mandatory = $false)]
        [string] $HorizontalAlignment = "Center",
        [Parameter(Mandatory = $false)]
        [string] $VerticalAlignment = "Center"
    )
    $dropDown1 = New-Object System.Windows.Controls.ComboBox
    $dropDown1.Margin = New-Object System.Windows.Thickness(0, 0, 10, 0)
    $dropDown1.HorizontalAlignment = $HorizontalAlignment
    $dropDown1.VerticalAlignment = $VerticalAlignment

    if ($Width -ne "") {         $dropDown1.Width = $Width    }
    if ($Height -ne "") {        $dropDown1.Height = $Height    }
    if ($FontSize -ne "") {        $dropDown1.FontSize = $FontSize }
    if ($Margin -ne "") {        $dropDown1.Margin = $Margin }

    return $dropDown1
}

function Get-ComboBox {
    param (
        [Parameter(Mandatory = $false)]
        [string] $Width,
        [Parameter(Mandatory = $false)]
        [string] $Height,
        [Parameter(Mandatory = $false)]
        [string] $FontSize,
        [Parameter(Mandatory = $false)]
        [string] $Margin,
        [Parameter(Mandatory = $false)]
        [string] $HorizontalAlignment = "Center",
        [Parameter(Mandatory = $false)]
        [string] $VerticalAlignment = "Center"
    )

    $comboBox1 = New-Object System.Windows.Controls.ComboBox
    $comboBox1.IsEditable = $true
    $comboBox1.HorizontalAlignment = $HorizontalAlignment
    $comboBox1.VerticalAlignment = $VerticalAlignment

    if ($Width -ne "") {         $comboBox1.Width = $Width    }
    if ($Height -ne "") {        $comboBox1.Height = $Height    }
    if ($FontSize -ne "") {        $comboBox1.FontSize = $FontSize }
    if ($Margin -ne "") {        $comboBox1.Margin = $Margin }

    return $comboBox1
    
}

function Get-RadioButton {
    param (
        [Parameter(Mandatory = $true)]
        [string] $value,
        [Parameter(Mandatory = $false)]
        [bool] $selected
    )

    $radioButton = New-Object System.Windows.Controls.RadioButton
    $radioButton.Content = $value
    $radioButton.IsChecked = $selected

    return $radioButton
    
}

function Get-CheckBox {
    param (
        [Parameter(Mandatory = $true)]
        [string] $Value,
        [Parameter(Mandatory = $false)]
        [string] $Margin,
        [Parameter(Mandatory = $false)]
        [string] $HorizontalAlignment = "Center",
        [Parameter(Mandatory = $false)]
        [string] $VerticalAlignment = "Center"
    )
    $checkBox = New-Object System.Windows.Controls.CheckBox
    $checkBox.Content = $Value 
    $checkBox.HorizontalAlignment = $HorizontalAlignment
    $checkBox.VerticalAlignment = $VerticalAlignment
    if ($Margin -ne "") {        $checkBox.Margin = $Margin }    
   

    return $checkBox
}
function Add-ControlToTableAt {
    param (
        [Parameter(Mandatory = $true)]
        [System.Windows.Controls.Grid] $TableObj,
        [Parameter(Mandatory = $true)]
        [int] $row,
        [Parameter(Mandatory = $true)]
        [int] $column,
        [Parameter(Mandatory = $true)]
        [System.Windows.UIElement] $Control
    )
    
    $TableObj.Children.Add($Control)    > $null
    [System.Windows.Controls.Grid]::SetRow($Control, $row)
    [System.Windows.Controls.Grid]::SetColumn($Control, $column)
}

function Get-TextCollectionControl($butttonName, $labelText){
    $Label = Show-Text -Text $labelText -IsBold $true -fontSize 18

    $textBox = Get-TextBox -VerticalAlignment "Top" -Margin "10,10,10,10" -Width 300 -Height 25 -FontSize 15

    $button = Get-Button -ButtonName $butttonName -Margin "10,0,0,10" -HorizontalAlignment "Center" -VerticalAlignment "Center"

    $stackpanel = New-Object Windows.Controls.StackPanel
    $stackpanel.Orientation = [Windows.Controls.Orientation]::Horizontal
    $stackpanel.Children.Add($Label) > $null
    $stackpanel.Children.Add($textBox) > $null
    $stackpanel.Children.Add($button) > $null

    return New-Object PSObject -Property @{
        control = $stackpanel
        textBox = $textBox
        button = $button
    } 
}

function Get-TopTabControl(){
    
    $TopTabControl = New-Object Windows.Controls.TabControl
    
    $DiagnosticsTabItem = New-Object Windows.Controls.TabItem
    $DiagnosticsTabItem.Header = "Diagnostics"
    
    $GatherSupportDataTabItem = New-Object Windows.Controls.TabItem
    $GatherSupportDataTabItem.Header = "Gather Support Data"

    # $TopTabControl.Items.Add($DiagnosticsTabItem) > $null
    $TopTabControl.Items.Add($GatherSupportDataTabItem) > $null

    return New-Object PSObject -Property @{
        TopTabControl = $TopTabControl
        # DiagnosticsTabItem = $DiagnosticsTabItem
        GatherSupportDataTabItem = $GatherSupportDataTabItem
    }
}

function Get-Table($columns, $rows){
    $tableGrid = New-Object System.Windows.Controls.Grid
    $tableGrid.Margin = New-Object System.Windows.Thickness(20)

    for($i=1; $i -le $columns; $i++){
        $column = New-Object System.Windows.Controls.ColumnDefinition
        $column.Width = New-Object System.Windows.GridLength(1, [System.Windows.GridUnitType]::Star)
        $tableGrid.ColumnDefinitions.Add($column) > $null
    }

    for($j=1; $j -le $rows; $j++){    
        $row1 = New-Object System.Windows.Controls.RowDefinition
        $row1.MinHeight = 25.0
        $tableGrid.RowDefinitions.Add($row1) > $null
    }
    return $tableGrid
}

function Get-TemplateGrid(){
    $grid = New-Object Windows.Controls.Grid

    # Define two columns with equal width
    $column1 = New-Object Windows.Controls.ColumnDefinition
    $column2 = New-Object Windows.Controls.ColumnDefinition
    $column1.Width = New-Object Windows.GridLength(250, [Windows.GridUnitType]::Pixel)
    $column1.MinWidth = 50
    $column1.MaxWidth = 300
    
    # Create a GridSplitter to allow resizing the columns
    $gridSplitter = New-Object Windows.Controls.GridSplitter
    $gridSplitter.ResizeDirection = [Windows.Controls.GridResizeDirection]::Columns
    $gridSplitter.ResizeBehavior = [Windows.Controls.GridResizeBehavior]::BasedOnAlignment
    $gridSplitter.HorizontalAlignment = [Windows.HorizontalAlignment]::Center
    $gridSplitter.VerticalAlignment = [Windows.VerticalAlignment]::Stretch
    
    $column2.Width = [Windows.GridLength]::Auto

    # Add the columns to the Grid
    $grid.ColumnDefinitions.Add($column1) > $null
    $grid.ColumnDefinitions.Add($column2) > $null
    $grid.Children.Add($gridSplitter) > $null

    # Create a StackPanel to hold your content
    $border = New-Object Windows.Controls.Border
    $border.BorderThickness = "0,0,3,0"
    $border.BorderBrush = [Windows.Media.Brushes]::LightGray
    $stackPanel = New-Object Windows.Controls.StackPanel
    $stackPanel.VerticalAlignment = [Windows.VerticalAlignment]::Center
    $border.Child = $stackPanel

    # Set the StackPanel as the content of the first column
    [Windows.Controls.Grid]::SetColumn($border, 0)
    $grid.Children.Add($border) > $null

    # Create another StackPanel for the second column
    $stackPanel2 = New-Object Windows.Controls.StackPanel
    $stackPanel2.VerticalAlignment = [Windows.VerticalAlignment]::Center

    # Set the second StackPanel as the content of the second column
    [Windows.Controls.Grid]::SetColumn($stackPanel2, 1)
    $grid.Children.Add($stackPanel2) > $null

    return New-Object PSObject -Property @{
        Grid = $grid
        Column1 = $stackPanel
        Column2 = $stackPanel2
    }
}

function Get-FileName{
    [CmdletBinding()]
    param (
        [System.Collections.ArrayList] $FilePath
        )
        
        if ($FilePath -eq $null)
        {
            return $Null
        }
        
        $fileList = [System.Collections.ArrayList]@()
        foreach ($file in $FilePath) {
            $fileList.Add($file.Split('\')[-1]) | Out-Null
        }
        
        return $fileList
}

function Get-FileButton{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string] $ButtonName,
        
        [Parameter(Mandatory = $true)]
        [string] $GlobalScopeName,
        
        [Parameter(Mandatory = $true)]
        [string] $GlobalVariableName,
        
        [Parameter(Mandatory = $true)]
        [string] $GlobalFileListName,

        [Parameter(Mandatory = $false)]
        [string] $Margin = "0,0,0,0",

        [Parameter(Mandatory = $false)]
        [int] $width=214,

        [Parameter(Mandatory = $false)]
        [int] $height = 46,

        [Parameter(Mandatory = $false)]
        [float] $fontSize = 15.0,

        [Parameter(Mandatory = $false)]
        [string] $FontFamily = "Microsoft Sans Serif",

        [Parameter(Mandatory = $false)]
        [string] $HorizontalAlignment = "Center",

        [Parameter(Mandatory = $false)]
        [string] $VerticalAlignment = "Center",
        
        [Parameter(Mandatory = $false)]
        [bool] $Multiselect = $true
    )
    
    $button = Get-Button -ButtonName $ButtonName -Margin $Margin -width $width -height $height -fontSize $fontSize -FontFamily $FontFamily -HorizontalAlignment $HorizontalAlignment -VerticalAlignment $VerticalAlignment
    $button.Tag = @{
        "GlobalScopeName" = $GlobalScopeName;
        "GlobalVariableName" = $GlobalVariableName;
        "GlobalFileListName" = $GlobalFileListName;
        "Multiselect" = $Multiselect }
    
    $button.Add_Click({    
        $fileDialog = New-Object System.Windows.Forms.OpenFileDialog
        $fileDialog.Multiselect = $this.Tag["Multiselect"]
        $fileDialog.Filter = "All files (*.*)|*.*"
        $result = $fileDialog.ShowDialog()
        if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
            $fileList = [System.Collections.ArrayList]@()
            foreach ($file in $fileDialog.FileNames) {
                $fileList.Add($file) | Out-Null
            }
            
            $globalScope=Get-Variable -Name $this.Tag["GlobalScopeName"] -Scope Global
            
            # Append already added files
            if ($globalScope.Value[$this.Tag["GlobalFileListName"]] -ne $null -and $fileDialog.Multiselect)
            {
                $fileList.AddRange($globalScope.Value[$this.Tag["GlobalFileListName"]]) | Out-Null
            }
            
            $fileList = [System.Collections.ArrayList]@($fileList| Sort-Object| Get-Unique)
            
            # Do something with the file data object
            $t = $fileList -join [Environment]::NewLine

            $globalScope.Value[$this.Tag["GlobalVariableName"]].Text = $t
            $globalScope.Value[$this.Tag["GlobalVariableName"]].Height = $fileList.Count * 30
            $globalScope.Value[$this.Tag["GlobalFileListName"]] = $fileList
            
            Set-Variable -Name $this.Tag["GlobalScopeName"] -Value $globalScope.Value -Scope Global
        }
    })
    
    return $button
}

function Get-ExportFolder{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string] $Component
    )
    
    $folderDialog = New-Object System.Windows.Forms.FolderBrowserDialog
    $result = $folderDialog.ShowDialog()
    if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
        $FolderPath = $folderDialog.SelectedPath
    }
    if (!$FolderPath) {
        [System.Windows.MessageBox]::Show("Folder not selected.", "Error", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
        return
    }
    
    # Get the created folder path and File Path
    $currentDate = Get-Date -Format "MM_dd_yyyy_HH_mm"
    $Folder   = $FolderPath + "\" + $Component + $currentDate
    # Create the destination folder if it doesn't exist
    if (-not (Test-Path $Folder)) {
        New-Item -ItemType Directory -Path $Folder | Out-Null
    }
    else {
        [System.Windows.MessageBox]::Show("Zip file already exists. Please choose a different name.", "Error", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
        return
    }
    
    return $Folder
}

function CleanAndShowFolder{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string] $Folder,

        [Parameter(Mandatory = $true)]
        [hashtable] $supportData,

        [Parameter(Mandatory = $true)]
        [string] $filePath
    )

    $supportData["Forests"] = $Global:ContextScopeVariables.forests
    #$supportData | Export-Clixml -Path $filePath

    $supportData | ConvertTo-Json -Depth 10 | Out-File $filePath

    # Zip the destination folder
    Compress-Archive -Path $Folder -DestinationPath $Folder".Zip" -Force
    $FolderPath = (Get-Item $Folder).parent.FullName
    Remove-Item -Recurse -Force $Folder

    # Show a success message and open the folder containing the zipped folder
    $message = "Files copied and zipped successfully. Zip file path: $Folder.Zip`n`nDo you want to open the folder containing the zip file?"
    $title = "Success" 
    $buttons = [System.Windows.MessageBoxButton]::YesNo
    $icon = [System.Windows.MessageBoxImage]::Information
    $result = [System.Windows.MessageBox]::Show($message, $title, $buttons, $icon)

    if ($result -eq [System.Windows.MessageBoxResult]::Yes) {
        Invoke-Item $FolderPath
    }
}

Export-ModuleMember -Function *
# SIG # Begin signature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