Redirect output to file from remote session


how can redirect output remote session local file? if add pipe tee or output-file at end of  an invoke-command cmdlet empty file created. file console output created ok local sessions.

i created remote session with

new-pssession -computername sharepointtest2 -credential fal\kraviss -name "newsession" -sessionoption (new-pssessionoption -nomachineprofile)

and ran with

invoke-command -session (get-pssession) -filepath "c:\documents , settings\kraviss\my documents\powershell\updatespperms.ps1"

is script using write-output, or write-host send results console?  write-host go straight console, , can't redirected.  should using write-output.

[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Error: 0x80073701 when trying to add Print Services Role in Windows 2012 Standard

Disconnecting from a Windows Server 2012 R2 file sharing session on a Windows 7,8,10 machine

Windows 2016 RDS event 1306 Connection Broker Client failed to redirect the user... Error: NULL