Powershell: Copy files and additional files with different name

Powershell Header

This maybe helps some people which need to copy mutiple files. In my example I search for Contoso in files called info_*****.txt I need to copy them and also copy the file data_*****.txt.

$sourceFolder = "E:\temp\source"
$destinationFolder = "E:\temp\folder1"

$files = Get-ChildItem $sourceFolder -Filter *.txt -Recurse | Select-String "Contoso" # Get all Files with Contoso
Write-Host "Files found: " $files.count # Number of files found
foreach ($file in $files){
Get-Childitem $sourceFolder | Where-Object { $_.name -eq $file.filename } | Copy-Item -Destination $destinationFolder # copy all info_*****.txt files
$name = $file.filename -replace "info_", "data_"
Get-Childitem $sourceFolder | Where-Object { $_.name -eq $name } | Copy-Item -Destination $destinationFolder # copy all data_*****.txt files
}

More Infos about Select-String and file copy

OCZ Vertex 2 Bluescreen after resume from Hibernate / Standby

OCZ Vertex2

Some weeks ago my HP Elitebook 8460w arrived. The first thing I did was installing a new OCZ Vertex 2 SSD and Windows 7 with Servicepack 1, I installed all the drivers from the HP Support Website and everything worked fine.

Now last week I tried to update the firmware on my OCZ Vertex 2 drive. Now with an Intel Rapid Storage driver installed, the OCZ Toolbox could not find the SSD drive and I could not update the SSD firmware. So I uninstalled the Intel Rapid Storage driver and updated the SSD. After I did this every thing still worked fine. But some days later I got the first Bluescreen after I came out of Hibernate. After searching for a solution I could see I am not the only one with this problem.

Now after some research I think I have the solution. This could be the Microsoft MSAHCI driver in Service Pack 1. After I installed the latest Intel Rapid Storage driver everything worked again.