8

Pattern Matching with PowerShell 1

view full story
linux-howto

http://serverfault.com – All, I am new to Windows admin-type stuff but I am familiar with Unix/Linux, etc. I have a simple PowerShell 1 script that should only copy files that match this naming convention: Daily_Reviews[1099-9987].journal My pattern in $source is causing errors: "Could not find part of the path.." Need to know how to do pattern matching in the PowerShell environment I guess Here is my code: $source = "C:\Users\Tom\Daily_Reviews\[\d\d\d\d\-\d\d\d\d\]\.journal" $destination ="C:\Users\Tom\Processed\" if(-not(Test-Path $destination)){mkdir $destination | out-null} Copy-Item $source $destinatio (HowTos)