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

Storing modules on a disk


After we have written script, binary, and manifest modules, there are several places where we can store them. They can be stored in the system folder where PowerShell is installed, or in a user's folder. In either case, the module is placed into a module directory, and the entire module is placed in the subdirectories that are named by module name, with the following exceptions:

  • Dynamic modules created using the New-Modules cmdlet can be named using the -Name parameter of the cmdlet

  • Modules imported from the assembly object using the Import-Module –Assembly command are named using the following syntax:

    "dynamic_code_module_" + assembly.GetName().

When storing files in the system folder, you have to create the following path:

C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

It needs to be emphasized that to modify the directory, administrator privileges are required. When we store files in the user's folder, we have to create the following path:

C:\Users\Administrator...