Powershell - Import Volume

Hi,

What does the command Import-Volume means in powershell?

In you have a look at the link below,

http://blogs.technet.com/b/heyscriptingguy/archive/2013/10/09/use-powershell-to-create-virtual-switches.aspx

He does import the volume hyper v

"Import-Module Hyper-V

$ethernet = Get-NetAdapter -Name ethernet

$wifi = Get-NetAdapter -Name wi-fi"

& dont really quite get it!

Why do you need to import the volume?

Thanks
LVL 1
defreyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
Module. Import-Module.
A module is a collection of Powershell cmdlets or functions that aren't loaded/present by default.
Import-Module loads the cmdlets from the the module and makes them accessible in the current session.
Powershell 3 and later will try to import required modules automatically, but before that, modules needed to be explicitly loaded (but it doesn't hurt to do it in PS 3.0 and later as well).
And the "Hyper-V" module must be imported in order to use the "New-VMSwitch" cmdlet.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David Johnson, CD, MVPOwnerCommented:
get-netadapter doesn't need import-module hyper-v as they are part of powershell core.
Get-VMSwitch  & New-VMSwitch are only applicable to hyper-v so they need the hyper-v module
0
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
There's a bit of a mix-up in there somewhere as far as the original question.

The TechNet post mentioned finds available network adapters on a given Hyper-V host and sets up a virtual switch (vSwitch) to be used for virtual machines (VMs) on that host.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.