function Load_gaming { param ($root) [XML]$Form = @" "@ # 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:gaming_btn_meg = $window.FindName("btnmeg") $Script:gaming_btn_itm = $window.findName("btnitm") $Script:gaming_ok = $window.findName("btnok") # Verknüpft feste Elemente $window.Title = $Script:Version $window.icon="$root/Source/Logo.png" return $window } $Script:gaming = Load_gaming $args[0] # Variable: $gaming $gaming.Add_MouseLeftButtonDown({ $gaming.DragMove() }) $gaming_btn_itm.Add_Click({ $Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl" $servername = '192.168.178.4' $username = 'spaethf' Write-Admin-Log "BTN ITM pressed" if (confirm "Bei dem Server gaming Server ITM wird eine Power Aktion ausgeführt") { $command = 'python tap_itm.py' #Execute SSH command echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command } }) $gaming_btn_meg.Add_Click({ $Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl" $servername = '192.168.178.4' $username = 'spaethf' Write-Admin-Log "BTN MEG pressed" if (confirm "Bei dem Server gaming Server MEG wird eine Power Aktion ausgeführt") { $command = 'python tap_meg.py' #Execute SSH command echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command } }) $gaming_ok.Add_Click({ $gaming.Hide() })