<# .SYNOPSIS .NOTES Version : 1.0 Author : Hubert CORNET Creation Date : Purpose/Change : .LINK https://www.tips-of-mine.fr .EXEMPLE .DESCRIPTION .PARAMETER .INPUTS .OUTPUTS .log> #> #---------------------------------------------------------[Initialisations]-------------------------------------------------------- # Définir l'action d'erreur pour continuer silencieusement $ErrorActionPreference = "SilentlyContinue" [void][system.reflection.Assembly]::LoadFrom("C:\Program Files (x86)\MySQL\MySQL Connector NET 8.0.32\Assemblies\v4.5.2\MySql.Data.dll") # Bibliothèques de fonctions requises #----------------------------------------------------------[Declarations]---------------------------------------------------------- # Version Script $sScriptVersion = "1.0" #Log File Info $sLogPath = "C:\Tmp" $sLogName = ".log" $sLogFile = Join-Path -Path $sLogPath -ChildPath $sLogName Start-Transcript -Path $sLogFile -NoClobber #-----------------------------------------------------------[Functions]------------------------------------------------------------ #--------------------------------------------------------[Debut Du Script]--------------------------------------------------------- $Mysqlhost= "10.78.56.51" $Mysqluser= "toor" $Mysqlpass= "jN7VKeR3jjexMLzG" $Mysqldatabase= "bugtracker" $Connection = [MySql.Data.MySqlClient.MySqlConnection]@{ConnectionString="server=$Mysqlhost;uid=$Mysqluser;pwd=$Mysqlpass;database=$Mysqldatabase"} $Connection.Open() $sql = New-Object MySql.Data.MySqlClient.MySqlCommand $sql.Connection = $Connection $sql.CommandText = "SELECT id,summary FROM mantis_bug_table where summary like '%Opcon%'" $myreader = $sql.ExecuteReader() #---------------------------------------------------------[Fin Du Script]---------------------------------------------------------- Stop-Transcript