How to install the module

Prepare your system

Install or run PowerShell

Please find out in the Internet how to get PowerShell for your system and how to run it. Here are the links to

Set the execution policy

that is feasible for your needs:
  1. run PowerShell via "Run as Administrator"
  2. issue the following command:
Set-ExecutionPolicy Bypass
# or
Set-ExecutionPolicy RemoteSigned
# or
Set-ExecutionPolicy Unrestricted

Load the module

by running the following command:
ipmo .\UIAutomation.dll
# or specify the full path to the library
ipmo C:\1\2\3\UIAutomation.dll
For general-purpose testing, the module can be placed in the following folder structure:
%userprofile%"\Documents\WindowsPowerShell\Modules\UIAutomation,
i.e. the full path to UIAutomation.dll would be:
%userprofile%"\Documents\WindowsPowerShell\Modules\UIAutomation\UIAutomation.dll

How to check that all is OK

Run the following command
(gmo uia*).Name
(gmo uia*).ExportedCommands.Count
The output should contains the name of module and the number of cmdlet found (may vary depending on the module evolution):
UIAutomation
434

How to automate loading the module

If you need to automate the process of loading the module, consider learning the topic "PowerShell profiles" and simply add to a profile you preferred to the ipmo line from samples above.
Follow, for example, the link http://technet.microsoft.com/en-us/library/ee692764.aspx
The good post about profiles: http://vmin.wordpress.com/2012/05/28/understanding-the-six-powershell-profiles-technet-blogs

Note, for most applications you'll never need to run PowerShell as Administrator. However sometimes, for example for testing services.msc, you need to run it as Run As Administrator or under domain admin credentials)

Last edited Jan 5, 2013 at 3:28 PM by xinliu, version 11

Comments

No comments yet.