locked
How to merge 3 output result of powershell script into a single file RRS feed

  • Question

  • HI,

    I am trying to Merge the resultant of 3 different scripts result into a single output file..for the Logged in Username, Logged in Computername and IP address to check the status of Windows Activation and output all the 3 result in a sorted CSV file for the below commands..

    I am trying to run a startup script to all the user and get the result stored in a single output file which is locating in server.

    $log = "\\myserver\Result\output_details.csv"
    #user name and computer hostname listing
    $env:USERNAME,$env:COMPUTERNAME |out-file $log -Encoding utf8
    # listing IP Address of the Machine
    Get-NetIPAddress -AddressState Preferred -AddressFamily IPv4 | Format-Table |Out-File $log -Encoding utf8
    #OS Status listing
    Get-CimInstance -ClassName SoftwareLicensingProduct |Where-Object PartialProductKey |Select-Object Name,Description,LicenseStatus,LicenseFamily | Format-Table |Out-File $log -Encoding utf8

    Monday, October 30, 2017 7:47 AM

All replies