From 9e80761f519eef7dc8981dbcbce39c869192c6bf Mon Sep 17 00:00:00 2001 From: Christian Maintz <christianmaintz@t-online.de> Date: Thu, 16 Jul 2020 13:51:52 +0200 Subject: [PATCH] =?UTF-8?q?Add=20new=20file:=20Run.ps1;=20Hauptfunktion=20?= =?UTF-8?q?zum=20ausf=C3=BChren=20der=20anderen=20Funktionen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Beispielprojekt/Run.ps1 | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Beispielprojekt/Run.ps1 diff --git a/Beispielprojekt/Run.ps1 b/Beispielprojekt/Run.ps1 new file mode 100644 index 0000000..b5bd95d --- /dev/null +++ b/Beispielprojekt/Run.ps1 @@ -0,0 +1,56 @@ +function Run +{ + # Setzen der Parameter für die Funktionen + [CmdletBinding()] + param + ( + # Pfad zur Excel-Datei (Inputdatei) + $xlsxpath = "C:\Verwaltungspfad\Files\mai.rwth-aachen.de.xlsx", + $Logpath = "C:\Verwaltungspfad\Files\Logs\$(Get-Date -format "yyyy_MM_dd__HH_mm")_Log.log" + ) + + #Starten des Loggings + Start-Transcript -Path $LogPath + + # Importieren der anderen Dateien + . .\Connect-Webservice.ps1 + . .\Initialize.ps1 + . .\Check-Invitations.ps1 + . .\Check-Quota.ps1 + . .\Check-Mailinglists.ps1 + + + # Diese funktion führt automatisch alle Schritte automatisch durch in folgender Reihenfolge: + + # Laden aller Module (Excel) + write-host "Die Funktion Load-Modules wird ausgeführt" -Foreground darkyellow + Initialize + write-host "Die Funktion Load-Modules ist durchgelaufen `n" -Foreground darkyellow + + + # Verbinden mit dem Webservice der RWTH Aachen + write-host "Die Funktion Connect-Webservice wird ausgeführt" -Foreground darkyellow + Connect-WebService + write-host "Die Funktion Connect-Webservice ist durchgelaufen `n" -Foreground darkyellow + + + # Überprüfung, ob neue Accounts existieren und ggf. Einladung erstellen + write-host "Die Funktion Check-Invitations wird ausgeführt" -Foreground darkyellow + Check-Invitations -xlsxpath $xlsxpath + write-host "Die Funktion Check-Invitations ist durchgelaufen `n" -Foreground darkyellow + + + # Überprüfung, ob das Quota der jeweiligen Accounts noch stimmt und anschließende Anpassung + write-host "Die Funktion Check-Quota wird ausgeführt" -Foreground darkyellow + Check-Quota -xlsxpath $xlsxpath + write-host "Die Funktion Check-Quota ist durchgelaufen `n" -Foreground darkyellow + + + # Überprüfung, ob alle Mailinglisten korrekt gesetzt sind und anschließende Anpassung + write-host "Die Funktion Check-Mailinglists wird ausgeführt" -Foreground darkyellow + Check-Mailinglists -xlsxpath $xlsxpath + write-host "Die Funktion Check-Mailinglists ist durchgelaufen `n" -Foreground darkyellow + + # Stoppen des Loggings + Stop-Transcript +} \ No newline at end of file -- GitLab