Advertisements
TRENDING

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

Advertisements
About BjTechNews (906 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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s