how to capture 'copy-item' output


is there way capture log/output of copy-item? -verbose shows outcome in command prompt.. when i'm using cmdlet part of large script, couldn't capture output...

thanks !


--ss | microsoft certified technology specialist (tfs 2010)

using -passthru parameter, can capture results varible.  note, variable populated if operation successful:

$x = copy-item -path 'test.txt' -destination 'c:\new folder' -passthru -erroraction silentlycontinue if ($x) { $x } else { "copy failure"} 


grant ward, a.k.a. bigteddy

what's new in powershell 3.0 (technet wiki)




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group