Can a script determine where "show-output" is going?
I am running a script, sometimes using "out-file" to catch messages, sometimes not.
In my script is a "write-host" cmdlt so I can see the messages and then I do a write-output cmdlt to ensure it is also in the out-file.
If I have not used an "out-file", I get the information twice on the screen.
To avoid this, can I detect if a running script is using "out-file"?
Then I could supress "write-output" when there is no out-file.
This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.