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
Post a Comment