B
B
Berkutman2019-05-01 09:38:02
PowerShell
Berkutman, 2019-05-01 09:38:02

How to display custom string output name in powershell?

Hello. how to output custom table name when executing Out-File command?
Tried Format-table NAME , doesn't work.
5cc93ec343b94188310548.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Berkutman, 2019-06-16
@Berkutman

This is how it is solved!

Команды выполнения | Out-File D:\TEXT.txt -Append -NoClobber
(Get-Content D:\TEXT.txt).replace('ScriptOutput(Какой текст заменяем)', 'Какой текст хотим получить"') | Out-File Out-File D:\TEXT.txt -Append -NoClobber

E
Eugene, 2019-05-01
@BeatHazard

If you just need to give the table a common name try something like this:
$1 = Get-NetAdapter ethernet | fl #for example
$2 = "Table Name"
$3 = "--------------------------"
$2,$3,$1 | Out-File -FilePath "c:\temp\1.txt"
If this is not exactly what you need, please provide an example script in which you get the table name and where it needs to be changed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question