PowerShell Extensions (PSCX) Installation Guide

Source: Internet
Author: User

In the process of playing ansible, PowerShell is not supported when using the Win_unzip module, you need to install Pscx to expand the PowerShell and record the installation process.

The Pscx downloaded from the official website is a zip file, which is a folder called "Pscx" after decompression. : http://pscx.codeplex.com/downloads/get/577965 need to put this folder in $env:home\documents\windowspowershell\modules, If I use win2008, I can put the Pscx folder under C:\Users\kingleft\Documents\WindowsPowerShell\Modules. If you do not have this folder, you can create one manually.If you want to install Pscx for the computer users, you need to put the Pscx folder under $pshome\modules, such as for my computer, need to put to C:\Windows\System32\WindowsPowerShell\ Under the V1.0\modules.

After you put the Pscx folder in place, you can import Pscx by running the import-module pscx command under PowerShell. The operation is simple, but the imported Pscx uses the default configuration. If you want to configure Pscx, you can modify the Pscx.UserPreferences.ps1 file under the Pscx folder, modify the configuration file after saving it, use the command import-module pscx-arg pscx the configuration file path \ Pscx.UserPreferences.ps1 to re-import the Pscx. For example, after I modify the configuration file, I run Import-module pscx–arg C:\Users\kingleft\Documents\WindowsPowerShell\Modules\Pscx\ Pscx.UserPreferences.ps1. Of course, this configuration file can be taken out of the other places to modify, as long as the import time to specify its location on the line.
By importing Pscx, you can use the Pscx extension feature in PowerShell. However, this method of import, after restarting PowerShell, just the effort will be invalidated.The workaround is to write the import command to the user PowerShell configuration file. The default User profile name is MICROSOFT.POWERSHELL_PROFILE.PS1 and can be seen under $env:home\documents\windowspowershell\. If you do not have this file, you can also go to create a new one, under PowerShell input command New-item–type File–force $profile on it.
Write in this user profileimport-module pscx–arg pscx configuration file path \pscx.userpreferences.ps1 You can load Pscx each time you start PowerShell.
Import-module Pscx–arg C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Pscx\Pscx.UserPreferences.ps1

Input Get-help Pscx | Less will be able to see the Pscx's Help file, more than the original more useful.


PowerShell Extensions (PSCX) Installation Guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.