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
    # Zip the destination folder
    Compress-Archive -Path $Folder -DestinationPath $Folder".Zip" -Force
    $FolderPath = (Get-Item $Folder).parent.FullName
    Remove-Item -Recurse -Force $Folder

    #[System.IO.Compression.ZipFile]::CreateFromDirectory($Folder, $Folder+".Zip", [System.IO.Compression.CompressionLevel]::Optimal, $false)

    # 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 block
# MIIoOwYJKoZIhvcNAQcCoIIoLDCCKCgCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC60tZRBDJMcEN4
# GLH0fNRob01lg+KC/F1IaVNhF2/qGaCCDYUwggYDMIID66ADAgECAhMzAAADri01
# UchTj1UdAAAAAAOuMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD
# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy
# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p
# bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwODU5WhcNMjQxMTE0MTkwODU5WjB0MQsw
# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u
# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy
# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
# AQD0IPymNjfDEKg+YyE6SjDvJwKW1+pieqTjAY0CnOHZ1Nj5irGjNZPMlQ4HfxXG
# yAVCZcEWE4x2sZgam872R1s0+TAelOtbqFmoW4suJHAYoTHhkznNVKpscm5fZ899
# QnReZv5WtWwbD8HAFXbPPStW2JKCqPcZ54Y6wbuWV9bKtKPImqbkMcTejTgEAj82
# 6GQc6/Th66Koka8cUIvz59e/IP04DGrh9wkq2jIFvQ8EDegw1B4KyJTIs76+hmpV
# M5SwBZjRs3liOQrierkNVo11WuujB3kBf2CbPoP9MlOyyezqkM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