Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

Jaz Jaz From the depths of Wales I come
  • add the remote folder i'm in to the filename, batchfile

    @Jaz:FECK ME

     

    1,2,3 |
    foreach { 
        $count = $_;
        gci -Path \\myserver-web$count\d$\IISLogs\ -include *.log -recurse | % { $dirName = $_.directoryname; $logname = $_.Name; $_ | Copy-Item -Destination $("D:\ServerLogsAndBackups\IIS\w"+$count+"\"+$dirname+"_"+$logName) -whatif }
    }

     

     

  • add the remote folder i'm in to the filename, batchfile

    @AndyC: I don't think i have.  

     

    really struggling with this...

    I missed the output before, i am looping over the files, copying 100 files named after the 1st file, then onto the 2nd file copying 100 files named after the 2nd, and so forth... make it stop

  • add the remote folder i'm in to the filename, batchfile

    @Jaz:

     

    1,2,3 |
    foreach { 
        $count = $_;
        $x = gci -Path \\uktv-web$count\d$\IISLogs\ -include *.log -recurse
        $x | ForEach-Object {
            Copy-Item $x -Destination $("D:\ServerLogsAndBackups\IIS\w"+$count+"\"+$_.Directory.Name+"_"+$_.Name) -whatIf
        }
            
    }

     

    cheers @AndyC

  • add the remote folder i'm in to the filename, batchfile

    @Jaz: Halfway there with this

     

    1,2,3 |
    foreach { 
        $count = $_;
        $x = gci -Path \\myserver-web$count\d$\IISLogs\ -include *.log -recurse
        $x | ForEach-Object {
            Copy-Item $x -Destination $("D:\ServerLogsAndBackups\IIS\w"+$count+"\"+$_.Directoryname+"_"+$_.Name) -whatIf
        }
            
    }

     

    however it's appending too much to the destination: D:\ServerLogsAndBackups\IIS\w1\uktv-web1\d$\IISLogs\W3SVC1135081669_ex110330.log

    when i want it to be: D:\ServerLogsAndBackups\IIS\w1\W3SVC1135081669_ex110330.log

     

    any tips?

  • add the remote folder i'm in to the filename, batchfile

    @AndyC:

    I tried this

     

    1,2,3 |
    foreach { 
        $count = $_; 
        $x = gci -Path \\myserver-web$count\d$\IISLogs\ -include *.log -recurse
    
        $x | Copy-Item -Destination D:\ServerLogsAndBackups\IIS\w$count\$_.DirectoryName_$_.Name -whatIf
    }

     

    however $_.DirectoryName_$_.Name aren't outputting anything... any ideas?

  • really microsoft... really?

    @cbae: two clicks and curiosity means you've failed as a search provider.... for data you OWN

  • really microsoft... really?

    @cbae: I'm not sure you understand what search is meant to do.  Search results are meant to scream the most relevant thing to you.  If it said "Powershell: homepage" or some such, I might have taken notice, but because only the 4th link really shows any semblance to that, i'm going to ignore the ones that don't seem relevant to me.

    Though you are right to an extent, it's not really the fault of the search engine, mainly the fault of the site editors and the titling of the sites and descriptions.

     

  • really microsoft... really?

    @cbae: I'm sorry, but I think the vast majority of people will disagree with you and your analogy.  This isn't a google search result where google is relying on a  tonne of rubbish data to serve up something. 

    Microsoft owns the data, it can choose what to serve up and how.  I showed you the first 4 search results and none of them scream out that they're a powershell homepage where you can find out all the information that you list in your post.

     

    Searching for Dogs on google and searching for Powershell on microsoft.com are very different because one company owns the data and the other doesn't.

  • really microsoft... really?

    @cbae: sorry but your analogy is completely wrong.

    Powershell is a Microsoft property, I'm searching from the main Microsoft site, not google, or askjeeves or twitter, but the actual main www.Microsoft.com site.  I don't see why I need to type in what you suggested to get to the powershell download site when powershell is the main keyword and the only keyword that matters.

  • really microsoft... really?

    Thanks for all the replies everyone.

     

    @CreamFilling512 New versions do but our windows 2003 server doesn't so i needed it for that

     

    @ScanIAm generally hits the nail on the head.  If you look at the search results I originally linked to.. which one of them actually says Download Powershell...

     

    The 1st one says "Scripting with Windows PowerShell", I want to download powershell, i may want to script later but first i want to download it, so thats not an obvious first choice.

    2nd Link is "Windows PowerShell Getting Started Guide", I might be able to download Powershell from here but still it's not an obvious link..

    3rd Link is "Running Windows PowerShell Scripts", I doubt I can download it from here

    4th Link is "Windows PowerShell".  This looks like the money shot, it looks like it has everything in the title that I want.  but where does it link you to... is it the download page? is it heck... http://technet.microsoft.com/en-us/library/bb978526.aspx what the hell is this? Still no download link on there.

     

    It really is a shame they make these things so hard to find.