bonjour,

je cherche a rediriger l'affichage a l'ecran de ce script PowerShell dans un fichier csv, mais je n'y arrive pas.
pourriez-vous m'aider svp ?

Code powershell : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
$path = “\\$serverName\c$\refer_c“
foreach ($serverName in (get-content c:\pc.txt))
{
       $dirSize = Get-ChildItem $path -recurse -force | select Length  |Measure-Object -Sum length
 
       $dirSize.sum = $dirSize.sum/1MB
       $finalResult = “{0:N2} MB” -f $result.sum
       $dirSize #Output the result to the screen
}

cordialement