Jump to content

Wolfernox

Members
  • Gesamte Inhalte

    11
  • Registriert seit

  • Letzter Besuch

Alle erstellten Inhalte von Wolfernox

  1. Wie erstelle ich eine Exceldatei mit powershell, in der dann meine variable "$inhalt" steht? [$inhalt = "test"]
  2. Danke bin noch ein Anfänger was powershell betrifft... könntest du mir sagen wo ich as genau reinschreiben muss?
  3. Hallo möchte den inhalt meiner csv-datei in eine listbox bekommen. Allerding soll in der listbox nur die erste spalte stehen. (also tisch, stuhl und maus. siehe bild) Mein jetziges script: Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Application]::EnableVisualStyles() [void][System.Reflection.Assembly]::LoadWithPartialName( “System.Windows.Forms”) [void][System.Reflection.Assembly]::LoadWithPartialName( “Microsoft.VisualBasic”) $Form = New-Object system.Windows.Forms.Form $Form.ClientSize = '1250,500' $Form.text = "Ticket-Mail Generator" $Form.TopMost = $false ####################################################################### # Labels ####################################################################### $User_Lable = New-Object system.Windows.Forms.Label $User_Lable.text = "User:" $User_Lable.AutoSize = $true $User_Lable.width = 25 $User_Lable.height = 10 $User_Lable.location = New-Object System.Drawing.Point(13,26) $User_Lable.Font = 'Microsoft Sans Serif,10' $Betreff_Lable = New-Object system.Windows.Forms.Label $Betreff_Lable.text = "Betreff:" $Betreff_Lable.AutoSize = $true $Betreff_Lable.width = 25 $Betreff_Lable.height = 10 $Betreff_Lable.location = New-Object System.Drawing.Point(13,52) $Betreff_Lable.Font = 'Microsoft Sans Serif,10' $Geschaeftsservice_Lable = New-Object system.Windows.Forms.Label $Geschaeftsservice_Lable.text = "Listbox:" $Geschaeftsservice_Lable.AutoSize = $true $Geschaeftsservice_Lable.width = 25 $Geschaeftsservice_Lable.height = 10 $Geschaeftsservice_Lable.location = New-Object System.Drawing.Point(13,105) $Geschaeftsservice_Lable.Font = 'Microsoft Sans Serif,10' $Inhalt_Lable = New-Object system.Windows.Forms.Label $Inhalt_Lable.text = "Inhalt:" $Inhalt_Lable.AutoSize = $true $Inhalt_Lable.width = 25 $Inhalt_Lable.height = 10 $Inhalt_Lable.location = New-Object System.Drawing.Point(13,145) $Inhalt_Lable.Font = 'Microsoft Sans Serif,10' ####################################################################### # Eingabefelder ####################################################################### $UserBox = New-Object system.Windows.Forms.TextBox $UserBox.width = 150 $UserBox.height = 20 $UserBox.location = New-Object System.Drawing.Point(72,22) $UserBox.Font = 'Microsoft Sans Serif,10' $BetreffBox = New-Object system.Windows.Forms.TextBox $BetreffBox.width = 350 $BetreffBox.height = 20 $BetreffBox.location = New-Object System.Drawing.Point(72,48) $BetreffBox.Font = 'Microsoft Sans Serif,10' $ListBox = New-Object system.Windows.Forms.ComboBox $ListBox.width = 1100 $ListBox.height = 20 $ListBox.location = New-Object System.Drawing.Point(129,101) $ListBox.Font = 'Microsoft Sans Serif,10' $ListBox.Items.Add($data); $Inhalt_txt = New-Object system.Windows.Forms.TextBox $Inhalt_txt.multiline = $true $Inhalt_txt.width = 950 $Inhalt_txt.height = 322 $Inhalt_txt.location = New-Object System.Drawing.Point(72,145) $Inhalt_txt.Font = 'Microsoft Sans Serif,10' ####################################################################### # Standartwert der Eingabefelder ####################################################################### $defaultValue = “” $UserBox.Text = $defaultValue $BetreffBox.Text = $defaultValue $ListBox.Text = $defaultValue $Inhalt_txt.Text = $defaultValue ####################################################################### # CSV-Datei ####################################################################### $data=Import-Csv -Path "C:\listbox.csv" ####################################################################### # Skript-Start ####################################################################### $Form.controls.AddRange(@($ListBox,$UserBox,$BetreffBox,$User_Lable,$Geschaeftsservice_Lable,$Betreff_Lable,$Inhalt_Lable,$Inhalt_txt,$Senden)) [void]$Form.ShowDialog()
  4. Habe ich und der Link sagt mir jetzt auch nichts. Bin noch Anfänger in Powershell
  5. okay das verstehe ich, aber da sagst du ja auch das immer "Hr. Mücke" $Person ist. ich möchte aber immer das was eine person in dieses Textfeld reingeschrieben hat. (also keine feste variable)
  6. Ok aber wie bekomme ich die eingaben zu einem string?
  7. ohne Outlook würde es auch gehen. hauptsache die mail wird am ende verschickt. und davor sollte man halt noch irgendwo sehen wie der text wirklich aussieht
  8. Hallo, ich habe ein Formular erstellt indem man Wörter in Textboxen schreiben kann und in einer Listbox einen buchstaben auswählen kann. Jetzt möchte ich mit diesen angaben eine Mail erstellen. Z.B.: Hallo, Das ist eine Testmail. User: <UserBox> Betreff: <BetreffBox> Listbox: <ListBox> Inhalt:<Inhalt_txt> | = Eingaben aus dem Formular Folgendes Script habe ich schon: Add-Type -AssemblyName System.Windows.Forms [ Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Application]::EnableVisualStyles() $Form = New-Object system.Windows.Forms.Form $Form.ClientSize = '1250,500' $Form.text = "Ticket-Mail Generator" $Form.TopMost = $false $ListBox = New-Object system.Windows.Forms.ComboBox $ListBox.text = "Bitte Auswählen" $ListBox.width = 1100 $ListBox.height = 20 @('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T') | ForEach-Object {[void] $ListBox.Items.Add($_)} $ListBox.location = New-Object System.Drawing.Point(129,101) $ListBox.Font = 'Microsoft Sans Serif,10' $UserBox = New-Object system.Windows.Forms.TextBox $UserBox.multiline = $false $UserBox.width = 150 $UserBox.height = 20 $UserBox.location = New-Object System.Drawing.Point(72,22) $UserBox.Font = 'Microsoft Sans Serif,10' $BetreffBox = New-Object system.Windows.Forms.TextBox $BetreffBox.multiline = $false $BetreffBox.width = 350 $BetreffBox.height = 20 $BetreffBox.location = New-Object System.Drawing.Point(72,48) $BetreffBox.Font = 'Microsoft Sans Serif,10' $User = New-Object system.Windows.Forms.Label $User.text = "User:" $User.AutoSize = $true $User.width = 25 $User.height = 10 $User.location = New-Object System.Drawing.Point(13,26) $User.Font = 'Microsoft Sans Serif,10' $Listbox = New-Object system.Windows.Forms.Label $Listbox.text = "Listbox:" $Listbox.AutoSize = $true $Listbox.width = 25 $Listbox.height = 10 $Listbox.location = New-Object System.Drawing.Point(13,105) $Listbox.Font = 'Microsoft Sans Serif,10' $Betreff = New-Object system.Windows.Forms.Label $Betreff.text = "Betreff:" $Betreff.AutoSize = $true $Betreff.width = 25 $Betreff.height = 10 $Betreff.location = New-Object System.Drawing.Point(13,52) $Betreff.Font = 'Microsoft Sans Serif,10' $Inhalt = New-Object system.Windows.Forms.Label $Inhalt.text = "Inhalt:" $Inhalt.AutoSize = $true $Inhalt.width = 25 $Inhalt.height = 10 $Inhalt.location = New-Object System.Drawing.Point(13,145) $Inhalt.Font = 'Microsoft Sans Serif,10' $Inhalt_txt = New-Object system.Windows.Forms.TextBox $Inhalt_txt.multiline = $true $Inhalt_txt.text = "Bitte den Inhalt hier rein schreiben." $Inhalt_txt.width = 950 $Inhalt_txt.height = 322 $Inhalt_txt.location = New-Object System.Drawing.Point(72,145) $Inhalt_txt.Font = 'Microsoft Sans Serif,10' $Senden = New-Object system.Windows.Forms.Button $Senden.text = "Senden" $Senden.width = 100 $Senden.height = 40 $Senden.location = New-Object System.Drawing.Point(1100,420) $Senden.Font = 'Microsoft Sans Serif,10,style=Bold' $Senden.BackColor = "White" $Senden.FlatStyle = "Flat" $Senden.FlatAppearance.BorderColor = "Gray" $Senden.FlatAppearance.MouseOverBackColor = "LightBlue" $Senden.Cursor=[System.Windows.Forms.Cursors]::Hand $Senden.Add_Click({$UserBox.clear()}) $Form.controls.AddRange(@($ListBox,$UserBox,$BetreffBox,$User,$Geschaeftsservice,$Betreff,$Inhalt,$Inhalt_txt,$Senden)) [void]$Form.ShowDialog() Wenn man auf "Senden" drückt soll sich das mail programm öffnen und die mail soll schon im mail programm stehen. (Mail-programm: Outlook 2013)
  9. Habe bis jetzt nur "Get-Content" von meiner Textdatei inder die Phade stehen mehr leider noch nicht... Ich weiß ja wie man datein verschieben kann möchte aber diese 800 Pfade ungerne alle abtippen
  10. Hallo, ich habe in frage bezüglich Powershell. Ich habe ein textdokument, indem ca. 800 Pfade zu PDF-Datein untereinander aufgelistet sind. Z.B.: J:\USER\HJD\A\AC\AfwCE\test1.pdf J:\USER\HJD\B\AC\ACEwef\test2.pdf J:\USER\HJD\KJGD\AC\AwfeCE\test3.pdf J:\USER\HJD\A\AdsC\ACgrthE\test4.pdf J:\USER\HJD\A\A4321C\ACjztE\test5.pdf J:\USER\HJD\A\LLLO\AzjtCE\test6.pdf und ich möchte die ganzen PDF-Datein auf mein C-Laufwerk in ein verzeichnis verschieben. Hat dafür jemand eine Lösung?
×
×
  • Neu erstellen...