#$outpath = [environment]::getfolderpath("mydocuments") + "\XenApp_Published_App_Report.csv" $outpath = "E:\XenApp_Published_App_Report.csv" $MonFichier = New-Item -type file $outpath -Force $line = [string] $line = "Nom application`tNom Serveur`tApplication active`tNombre de serveurs" ADD-content -path $outpath -value $line $xaapplist = get-xaapplication foreach ($application in $xaapplist) { $appreport = get-xaapplicationreport -BrowserName $application.BrowserName if ($appreport.enabled -eq $true) { $MesServers = $appreport.ServerNames foreach ($UnServer in $MesServers) { Write-Host "$($application.BrowserName)`t$UnServer`t$($appreport.enabled)`t$($appreport.ServerNames.Count)" $line = "$($application.BrowserName)`t$UnServer`t$($appreport.enabled)`t$($appreport.ServerNames.Count)" ADD-content -path $outpath -value $line } } }