What's New

Powershell: Folders and Subfolders

I had prepare a network share with folders and subfolders, and I wasn’t going to do it the manual way ;). That’s when PowerShell comes in and saves the day. Check out the video below for details on the script.

$Folder=”\\bjtechsvr\Public\”
$archs = “x86”
$OSs = “Vostro 220″,”Vostro 220s”,”Vostro 230″,”Latitude D630″,”Latitude 630″,”Vostro 200″
$Makes = “USB”,”Network”,”Display”,”Audio”,”Media”

foreach ($arch in $archs)
{
foreach ($OS in $OSs)
{
foreach ($make in $Makes)
{
New-Item -path “$Folder\$OS $arch” -Name “$Make” -Type directory
}#close $make loop
}#close $OS loop
}#close $arch loop

About BjTechNews (1061 Articles)
An IT guy trying to learn everything about technology and sharing it with you all. I'm a blogger and video blogger who highlights daily news in the tech industry, promoting tips and hacks for fellow techies.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: