Installing and configuring PowerShell

  1. Download PowerShell:
    • PowerShell is built into Windows 10 and Windows Server 2016 onwards. You can check the current PowerShell version by opening PowerShell and running the command  Get-Host | Select-Object Version.
    • If you are using an older version of Windows or want to update PowerShell, you can download the latest version from the official Microsoft website or through the Windows Management Framework.
  2. Install PowerShell:
    • If you download the PowerShell installation version from the Microsoft website, run the installation file and follow the onscreen instructions to complete the installation.
    • If you use Windows Management Framework, download the version appropriate for your operating system and install it.
  3. Check PowerShell version:
    • Once installed, open PowerShell and run a command  Get-Host | Select-Object Version to verify the current PowerShell version.
  4. PowerShell configuration:
    • PowerShell has a configuration file called “profile” that helps you customize your working environment.
    • To find the configuration file location, run the command  notepad $PROFILE in PowerShell. If the file does not exist, PowerShell creates a new file and opens it in Notepad.
    • You can add configurations and customizations to the profile file to set up the working environment as you like, such as setting environment variables, loading extension modules, creating custom functions, etc.
  5. Start using PowerShell:
    • To open PowerShell, you can search for “PowerShell” in the Start menu or right-click on the background and select “Windows PowerShell” or “Windows PowerShell (Admin)”.
    • When the PowerShell window opens, you can start using commands and cmdlets to manage and control your Windows system.

Installing and configuring PowerShell is a relatively simple process. Below are the steps to install and configure PowerShell on Windows operating system:

  1. Check PowerShell version: Before installing PowerShell, check the PowerShell version installed on your system. Open a PowerShell session and run the following command:

$PSVersionTable.PSVersion

This will display the current version of PowerShell installed.

  1. Download Windows Management Framework (WMF): PowerShell is often included as part of the Windows Management Framework. Go to the Microsoft Download Center (  https://aka.ms/wmfdownload  ) and download the appropriate version of Windows Management Framework for your operating system. Make sure to download the latest stable release.
  2. Run the Installer: After downloading the Windows Management Framework package, run the installer with administrative rights. Follow the on-screen instructions to complete the installation. The installation process may require a system reboot.
  3. Verify settings: Once installation is complete, open a PowerShell session and run the following command to verify settings:

Get-Host | Select-Object Version

This will display the version of PowerShell installed on your system.

  1. Configure Execution Policy (Optional): PowerShell has execution policies that determine the level of security when running scripts. By default, the execution policy is set to “Restricted” to prevent the execution of any scripts. You can configure the enforcement policy to an easier level if required. To set an execution policy, open a PowerShell session with administrative privileges and run the following command:

Set-ExecutionPolicy <PolicyName>

Replace   <PolicyName> with one of the following options:

  • Restricted: Default policy; do not run scripts.
  • RemoteSigned: Allows running scripts downloaded from the internet.
  • AllSigned: Requires all scripts to be digitally signed.
  • No restrictions: Allows running all scripts without restrictions.
  1. Additional configuration (Optional): You can customize your PowerShell experience by modifying your PowerShell configuration, setting default variables, and configuring modules and aliases. These settings are stored in separate profiles for the current user and all users on the system.
  • Current user profile: Open a PowerShell session and run the command   $PROFILE. This will display the path to your current user’s PowerShell profile script (e.g.   C:\Users\<Username>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1). Edit this file to add any desired customizations.
  • All user profiles: Open a PowerShell session with administrative privileges and run the command   $PROFILE.AllUsersCurrentHost. This will display the path to all users’ PowerShell profile scripts (e.g.   C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1). Edit this file to add any desired customizations.

Please note that modifying records requires administrative rights.

In short, to install and configure PowerShell, you can download the latest version from the Microsoft website or use Windows Management Framework. Once installed, you can customize your working environment through the configuration file (profile). Once installed and configured, you can start using PowerShell to manage and control your Windows system.

SHARE
By Benedict

Leave a Reply

Your email address will not be published. Required fields are marked *

No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.