<# .SYNOPSIS .NOTES Version : 1.0 Author : Hubert CORNET Creation Date : 18/11/2022 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" #----------------------------------------------------------[Declarations]---------------------------------------------------------- # Version Script $sScriptVersion = "1.0" #Log File Info $sLogPath = "C:\Tmp" $sLogName = "Task-Defrag.log" $sLogFile = Join-Path -Path $sLogPath -ChildPath $sLogName Start-Transcript -Path $sLogFile -NoClobber #-----------------------------------------------------------[Functions]------------------------------------------------------------ #------------------------------------------------------------[Script]-------------------------------------------------------------- defrag /C #---------------------------------------------------------[Fin Du Script]---------------------------------------------------------- Stop-Transcript