This would write the output to a logfile:
& $Env:WinDir\\system32\\inetsrv\\appcmd.exe >test.log
But what if I wanted to keep the output