locked
Scheduled Task Using Powershell - Truncating Output RRS feed

  • Question

  • I have a scheduled PowerShell task set to run whether a user is logged in or not and with highest privileges. It's as follows:

    powershell -command &{Get-VMReplication >C:\replicationhealth.txt}

    This works fine when I provide the domain admin userid & password, but if I change it to run with the SYSTEM account it runs, but it truncates the text file output at 80 characters. Hopefully this is an easy question, but how do I get the SYSTEM account to output the result without truncating each line at 80 characters?
    Saturday, April 14, 2018 3:18 PM

Answers

  • powershell -command &{Get-VMReplication | out-file C:\replicationhealth.txt -Width 300}

    \_(ツ)_/

    • Marked as answer by js0873x Saturday, April 14, 2018 5:53 PM
    Saturday, April 14, 2018 5:09 PM

All replies

  • powershell -command &{Get-VMReplication | out-file C:\replicationhealth.txt -Width 300}

    \_(ツ)_/

    • Marked as answer by js0873x Saturday, April 14, 2018 5:53 PM
    Saturday, April 14, 2018 5:09 PM
  • Looks like a winner to me. Thx.
    Saturday, April 14, 2018 5:53 PM