Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell script to create subfolder in all folders, but not create if existing

$
0
0

So I already have this:

ForEach($dir in (Get-ChildItem 'F:\Clients\myapp\utah-catholic\' | Where{$_.psiscontainer}))
{
    New-Item "$($dir.fullname)\History" -type directory | Out-Null
}
What I need to do is this same process, but ONLY create "History" folder if it does not currently exist.


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>