Book Image

PowerShell 3.0 Advanced Administration Handbook

By : Sherif Talaat, Haijun Fu
Book Image

PowerShell 3.0 Advanced Administration Handbook

By: Sherif Talaat, Haijun Fu

Overview of this book

<p>Technology’s growing rhythm is running faster than before, and business needs are getting more complex every day. So, it is time to learn something new to help conquer the challenge. With PowerShell in your toolbox, you can easily perform many tasks with less time, effort, and cost. PowerShell is a helpful scripting technology that enables the automation of system management tasks and the creation of system management tools.<br /><br />"PowerShell 3.0 Advanced Administration Handbook" comes with a set of real-world scenarios and detailed scripts that will help you get started with PowerShell, learn what PowerShell is, how to write the syntax, and build your scripts, and how to use and integrate PowerShell with different technologies, products, and tools.<br /><br />This handbook starts with the essential topics of PowerShell, then introduces the new features in PowerShell 3.0. The book then goes through building PowerShell scripts, function, and developing extensions like snap-ins and modules, and continues with detailed examples showing the usage of PowerShell with different technologies and products to give you an idea of PowerShell usage in the real world.</p>
Table of Contents (21 chapters)
PowerShell 3.0 Advanced Administration Handbook
Credits
About the Authors
Acknowledgement
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Working with multiple versions of modules


Sometimes, we need to develop several versions of modules for different PowerShell versions or Windows versions. We have two or more versions of the module that we need to be able to load in order to support users and do development.

The PSModulePath variable contains a semicolon-delimited list of folder paths that PowerShell searches for modules. Some people may think of a PowerShell module as basically a .dll (binary module), .psm1 (script module), or .psd1 (manifest module) file, but it's never just one file; it's a group of folders and files. In order for PowerShell to find the PSNet module when you type Import-Module PSNet, you have to set up a folder in PSModulePath named PSNet and also a file (.dll, .psm1, or .psd1) named PSNet.

As we all know, PowerShell has a -version parameter that is used to specify the PowerShell version. We can execute this in the console as follows:

powershell.exe -version 3.0

We may get a different result when we tell...