DaveWentzel.com            All Things Data

FileSystemManipulationScripts

Create a Folder
new-item -Path c:\ -Name TestFolder -Type directory
 
Loop Through All Folders
foreach ($subfolder in Get-ChildItem $sqlScriptDirectory -Recurse | Where-Object {$_.PSIsContainer} | Sort-Object Name)){
 
}
 
Loop Through Only Files
foreach ($subfolder in Get-ChildItem $sqlScriptDirectory -Recurse | Where-Object {!$_.PSIsContainer} | Sort-Object Name)){
 
}
foreach ($subfolder in Get-ChildItem $sqlScriptDirectory -Recurse | Where-Object {!$_.PSIsContainer} | Sort-Object Name)){
 
}foreach ($subfolder in Get-ChildItem $sqlScriptDirectory -Recurse | Where-Object {!$_.PSIsContainer} | Sort-Object Name)){
 
}
foreach ($subfolder in Get-ChildItem $sqlScriptDirectory -Recurse | Where-Object {!$_.PSIsContainer} | Sort-Object Name)){
 
}

Add new comment