<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'app:forums' matching tags 'file system', 'remote powershell', 'powershell remoting', 'batch multiple command lines powershell windows', and 'copy-item'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=app:forums&amp;tag=file+system,remote+powershell,powershell+remoting,batch+multiple+command+lines+powershell+windows,copy-item&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:forums' matching tags 'file system', 'remote powershell', 'powershell remoting', 'batch multiple command lines powershell windows', and 'copy-item'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Move Folders and its sub folders from one server to another server.</title><link>http://powershell.com/cs/forums/thread/15200.aspx</link><pubDate>Thu, 08 Mar 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:15200</guid><dc:creator>aravindcyadav</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am a new to power shell. I am going to thinking to write a script that as below:&lt;/p&gt;
&lt;p&gt;Move Folders and its sub folders from one server to another server. The servers may be 2003 or 2008. I am using Power shell V2.&lt;/p&gt;
&lt;p&gt;I write a script as below. Is it works or any thing I have to modify. If something wrong, please advice me for the below script.&lt;/p&gt;
&lt;p&gt;1. First it will get SERVER NAME from Input Box.&lt;/p&gt;
&lt;p&gt;2. Second it will get SOURCE Path and then DESTINATION Path from Input Box.&lt;/p&gt;
&lt;p&gt;3. It will get User Name and Password from&amp;nbsp;Get-Credential&lt;/p&gt;
&lt;p&gt;- - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&lt;/p&gt;
&lt;p&gt;cls&lt;br /&gt;[void][System.Reflection.Assembly]::LoadWithPartialName(&amp;#39;Microsoft.VisualBasic&amp;#39;) &lt;br /&gt;$sname = [Microsoft.VisualBasic.Interaction]::InputBox(&amp;quot;Enter your Server Name&amp;quot;, &amp;quot;Name&amp;quot;, &amp;quot;$env:username&amp;quot;) &lt;br /&gt;$spath = [Microsoft.VisualBasic.Interaction]::InputBox(&amp;quot;Enter your Source Path. Ex: \\servername\C$\Temp&amp;quot;) &lt;br /&gt;$dpath = [Microsoft.VisualBasic.Interaction]::InputBox(&amp;quot;Enter your Destination Path. Ex: \\servername\D$\Temp&amp;quot;)&lt;br /&gt;$cred = Get-Credential&lt;br /&gt;$tspath = Test-Path $spath&lt;br /&gt;$tdpath = Test-Path $dpath&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if ($tspath -eq &amp;quot;TRUE&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;Invoke-Command -ComputerName $sname -ScriptBlock { Copy-Item $spath $dpath -Recurse -Force } -Credential $cred&lt;br /&gt;Invoke-Command -ComputerName $sname -ScriptBlock {remove-Item -path $spath -Force } -Credential $cred&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $a = new-object -comobject wscript.shell&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $b = $a.popup(&amp;quot;Folder dose not exist&amp;quot;,0,&amp;quot;Warning Message Box&amp;quot;,1)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;- - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Install Dotnet Framework 4 using powershell.</title><link>http://powershell.com/cs/forums/thread/14193.aspx</link><pubDate>Wed, 25 Jan 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:14193</guid><dc:creator>virtuallynothere</dc:creator><description>&lt;p&gt;Thanks, remoting is enabled and I will verify credssp is enabled as I am not positive about that. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Why would credssp be required for this script if the client computer and destination server are in the same domain and the account used to login and also to run the remote powershell session are both domain admin accounts?&lt;br /&gt;&lt;br /&gt;I know credssp is for multi-hop authentication, but it didn&amp;#39;t look like that was required in this configuration I am using.&lt;/p&gt;
&lt;p&gt;Also, for the file copy portion, I have another script that just copies a file and that works fine being run exactly as I ran this. &amp;nbsp;How does that work? &amp;nbsp;That script is below and I&amp;#39;ve not had any issues with it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Import-Csv c:\Scripts\servers.txt | foreach {&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;$server = $_.name&amp;nbsp;&lt;/p&gt;
&lt;p&gt;$location = &amp;quot;\c:\Temp&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Copy-Item &amp;quot;\\server\Applications\dotnet4\dotNetFx40_Full_x86_x64.exe&amp;quot; -Destination $location -Force -ErrorAction silentlyContinue | out-null&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if(-not $?)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;{&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;ERROR: could not copy file(s) to: $server at $location&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&amp;nbsp;&lt;/p&gt;
&lt;p&gt;} | out-file errors.txt&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>