never-displayed
View discussion in a popup
You can do something like this.
Save the original script in .ps1 file and call the script and then export the output.
Ex:
.\Hosthardwareinfo.ps1 |Export-Csv -Path 'D:\Temp\hosthardwareinfo.csv' -NoTypeInformation -NoClobber