Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| prog:powershell-array [2021/11/01 18:06] – cb | prog:powershell-array [2023/06/17 14:01] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| {{youtube> | {{youtube> | ||
| + | < | ||
| + | # | ||
| + | $Array = @() | ||
| + | |||
| + | $Processes = Get-Process | ||
| + | # On charge un tableau | ||
| + | Foreach($proc in $Processes) | ||
| + | { | ||
| + | if ( $proc.ws/ | ||
| + | $proc.ws/ | ||
| + | write-host $proc.name | ||
| + | $array += New-Object psobject -property @{' | ||
| + | } | ||
| + | } | ||
| + | # on ne prends que 2 champs et on exporte dans un csv | ||
| + | $Array | select ' | ||
| + | |||
| + | $csvimport = @() | ||
| + | $csvimport = import-csv .\file.csv | ||
| + | |||
| + | ForEach($dog in $csvImport){Write-host " | ||
| + | </ | ||