Tip: You can store the output of a command in a variable and at the sametime have this output on the screen.
It is like “2 in 1”, you save and output.
Note: no need to put the $ sign.
1 |
Get-ChildItem -OutVariable files |
One line (needed to store and output on the screen)
Two lines (needed to store and output on the screen)
Pingback: Powershell Tip #7: Convert WMI date to Datetime | Powershell Guru