140 lines
6.1 KiB
PowerShell
140 lines
6.1 KiB
PowerShell
function Load_getlogs {
|
|
param ($root)
|
|
[XML]$Form = @"
|
|
<?xaml encoding="utf-8"?>
|
|
<Window
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
|
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
|
Name="Window" Title="Cleaner - Information" Height="348" Width="406" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None" Topmost="true">
|
|
<Grid Background="#00344E">
|
|
<Button Name="btnok" Content="OK" HorizontalAlignment="Left" Margin="165,294,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
|
<Button.Resources>
|
|
<Style TargetType="Border">
|
|
<Setter Property="CornerRadius" Value="2"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
<Button.Style>
|
|
<Style TargetType="Button">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="Red"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
<Label Content="Außer Betrieb" HorizontalAlignment="Center" VerticalAlignment="Top" Width="406" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
|
|
<Button x:Name="btn_cert" Content="Certificate" HorizontalAlignment="Left" Margin="33,53,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
|
<Button.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="2"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
<Button.Style>
|
|
<Style TargetType="{x:Type Button}">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="Red"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
<Button x:Name="btn_zeroconfig" Content="ZeroConfig" HorizontalAlignment="Left" Margin="33,100,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
|
<Button.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="2"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
<Button.Style>
|
|
<Style TargetType="{x:Type Button}">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="Red"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
<Button x:Name="btn_zeroconfigcert" Content="ZeroConfig
Certtificate" HorizontalAlignment="Left" Margin="33,147,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
|
<Button.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="2"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
<Button.Style>
|
|
<Style TargetType="{x:Type Button}">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="Red"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
<Button x:Name="btn_defudbu" Content="DEFU DB
 Update" HorizontalAlignment="Left" Margin="33,194,0,0" HorizontalContentAlignment="Center" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
|
<Button.Resources>
|
|
<Style TargetType="{x:Type Border}">
|
|
<Setter Property="CornerRadius" Value="2"/>
|
|
</Style>
|
|
</Button.Resources>
|
|
<Button.Style>
|
|
<Style TargetType="{x:Type Button}">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="Red"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
</Grid>
|
|
</Window>
|
|
"@
|
|
|
|
# Lädt das Fenster
|
|
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
|
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
|
$window=[Windows.Markup.XamlReader]::Load($NR)
|
|
|
|
# Objekt - Variablen Verknüpfung
|
|
|
|
$Script:getlog_btn_cert = $window.findName("btn_cert")
|
|
$Script:getlog_btn_zeroconfig = $window.findName("btn_zeroconfig")
|
|
$Script:getlog_btn_zeroconfigcert = $window.findName("btn_zeroconfigcert")
|
|
$Script:getlog_btn_defudbu = $window.findName("btn_defudbu")
|
|
$Script:getlog_btn_ok = $window.findName("btnok")
|
|
|
|
# Verknüpft feste Elemente
|
|
$window.Title = $Script:Version
|
|
$window.icon="$root/Source/Logo.png"
|
|
return $window
|
|
}
|
|
|
|
$Script:getlog = Load_getlogs $args[0] # Variable: $getlog
|
|
|
|
$getlog.Add_MouseLeftButtonDown({
|
|
$getlog.DragMove()
|
|
})
|
|
|
|
$getlog_btn_cert.Add_Click({
|
|
ii $Script:cert_path
|
|
})
|
|
|
|
$getlog_btn_zeroconfig.Add_Click({
|
|
ii $Script:zero_config_path
|
|
})
|
|
|
|
$getlog_btn_zeroconfigcert.Add_Click({
|
|
ii $zero_config_path\Certs\update-idrac-cert
|
|
})
|
|
|
|
$getlog_btn_defudbu.Add_Click({
|
|
ii $defudbu_path\ProcessUpdatableDevices\LogFiles
|
|
})
|
|
|
|
$getlog_btn_ok.Add_Click({
|
|
$getlog.Hide()
|
|
}) |