<# .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" # 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 $ComputerName = Get-WMIObject Win32_ComputerSystem| Select-Object -ExpandProperty Name $Date = Get-date -format yyyy-MM-dd-hhmm $LogName = "C:\Temp\$ComputerName - $Date.txt" $Extension = "*.csv" #-----------------------------------------------------------[Functions]------------------------------------------------------------ #------------------------------------------------------------[Script]-------------------------------------------------------------- Start-Transcript $LogName Get-ChildItem -Path \ -Filter $Extension -Recurse -File -Name| ForEach-Object { [System.IO.Path]::GetFileNameWithoutExtension($_) } Stop-Transcript