Create directory if it does not exist
Try the -Force parameter: You can use Test-Path -PathType Container to check first. See the New-Item MSDN help article for more details.
Try the -Force parameter: You can use Test-Path -PathType Container to check first. See the New-Item MSDN help article for more details.
Not much documentation on PowerShell loops. Documentation on loops in PowerShell is plentiful, and you might want to check out the following help topics: about_For, about_ForEach, about_Do, about_While. Another idiomatic PowerShell solution to your problem is to pipe the lines of the text file to the ForEach-Object cmdlet: Instead of regex matching inside the loop, you could pipe the lines through Where-Object to … Read more