'Getting an executable output in Azure Pipeline's PowerShell@2

I'm trying to debug my code because it isn't working on the pipeline. It is working locally. I have C# code that writes to both the Console.Out and Console.Error in my executable. Neither is being outputted to the Task output. How do I copy my output from the executable onto the PowerShell task?

- task: PowerShell@2
  displayName: Create Link
  inputs:
    targetType: 'inline'
    script: |
      '& ./CreateShortcut.exe
      --icon $(Build.ArtifactStagingDirectory)/PI_Icon.ico
      --shortcutPath $(Build.ArtifactStagingDirectory)/Temp.lnk
      --exe ./Bin/Application/Temp.exe'
    workingDirectory: 'Temp/BuildEvents/CreateShortcut/bin/Debug/net48'
    showWarnings: true


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source