Out-string
Aller à la navigation
Aller à la recherche
| Fiche express | |
|---|---|
| Domaine | Sortie / conversion |
| Cmdlet | Out-String
|
| Voir aussi | Out-* |
Out-String convertit les objets du pipeline en une chaîne de caractères mise en
forme (comme l'affichage console), avec des options supplémentaires par rapport aux
redirections > et >>.
Usage
# Transtypage en chaîne
Get-Process powershell | Out-String -Stream | Set-Content fichier.txt
Get-Process powershell | Out-File fichier.txt -Encoding ascii
Get-Process powershell | Out-File fichier.txt -Append -Encoding ascii
Options
-FilePath <string> fichier de sortie -Encoding <string> unicode (défaut), ascii, UTF7, UTF8, BigEndianUnicode, UTF32, Default, OEM -Append <switch> ajoute au fichier existant -Width <int> nombre max de caractères par ligne -InputObject <PSObject> objet à écrire -NoClobber <switch> ne pas remplacer un fichier existant