Try Playground
Show / Hide Table of Contents

Set up PowerShell Environment

NCache provides integration with Windows PowerShell to easily automate its administrative processes. Moreover, NCache remote tasks can also be managed over the network through a single machine using PowerShell cmdlets.

Prerequisites

  • Make sure that you have installed NCache Version 4.8+.

  • The NCache PowerShell Provider is compatible with PowerShell version 5.1 up to 7.3.9.

  • For Windows Server 2016, make sure that the environment variable PSModulePath has been refreshed before using NCache PowerShell commands.

For more detail on Windows PowerShell, please refer to the Microsoft Windows PowerShell section.

NCache PowerShell Management

  • Go to the Start menu on the Taskbar and search for NCache PowerShell Management.

  • Click on the appropriate search result. This will open an instance of PowerShell with ncacheps imported, and display a list of all the NCache PowerShell cmdlets.

Standard PowerShell

You must launch a new/fresh instance of Windows PowerShell so %NCHOME%environment variable setup by NCache installation is visible. PowerShell cmdlets make use of this environment variable.

  • Go to Start menu on the Taskbar and type Windows PowerShell.

  • Right-click on the Windows PowerShell result and select Run as Administrator. This launches PowerShell with Administrator privileges.

  • Verify that environment variable $Env:NCHOME is pointing to NCache installation directory.

PS C:\WINDOWS\system32> $Env:NCHOME
C:\Program Files\NCache

Import NCache PowerShell Module

You may be unable to run NCache PowerShell cmdlets if the environment variable PSModulePath has not been refreshed after the installation. Import the NCache PowerShell module (ncacheps.dll) found in the location %NCHOME%\bin\tools\ncacheps.

Execute the following command on Windows PowerShell to import the module:

Import-Module 'C:\Program Files\NCache\bin\tools\ncacheps\ncacheps'

In order to verify if the environment variable PSModulePath has been refreshed successfully, run the following command using Command Prompt (Run as Administrator).

echo %PSModulePath%

On running the following command, the path for ncacheps gets displayed. If the output displays %NCHOME%\bin\tools it means that the environment variables are refreshed.

When to Run PowerShell as Administrator

You need to run PowerShell as Administrator while performing the following operations:

  • Restarting NCache Service,
  • Running any custom scripts which use NCache cmdlets.

Run Custom Scripts

If you wish to create and execute PowerShell scripts using cmdlets:

  • Search for Windows PowerShell and Run as Administrator

  • Set script execution policy to RemoteSigned to allow remote execution:

Set-ExecutionPolicy RemoteSigned

List NCache PowerShell Cmdlets

In order to get a list of all the supported functionalities of NCache for PowerShell, execute the following command on Windows PowerShell:

Get-Command –Module ncacheps

Get Help for PowerShell cmdlets

In order to get complete help for any particular cmdlet, execute the following command on Windows PowerShell.

Get-Help <CmdletName> –Full

Following example shows how to get complete help for Get-Caches.

Get-Help Get-Caches –Full

Troubleshooting

Unable to Run NCache PowerShell Cmdlets

This occurs if the environment variable PSModulePath has not been refreshed after the installation. Import the NCache PowerShell module (ncacheps.dll) found in the location %NCHOME%\bin\tools\ncacheps.

Execute the following command on Windows PowerShell to import the module:

Import-Module 'C:\Program Files\NCache\bin\tools\ncacheps\ncacheps'

In order to verify if the environment variable PSModulePath has been refreshed successfully, run the following command using Command Prompt as Administrator.

echo %PSModulePath%

On running the following command, the path for ncacheps is displayed. If the output displays %NCHOME%\bin\tools it means that the environment variables are updated.

In This Article
  • Prerequisites
  • NCache PowerShell Management
  • Standard PowerShell
    • Import NCache PowerShell Module
  • When to Run PowerShell as Administrator
  • Run Custom Scripts
  • List NCache PowerShell Cmdlets
  • Get Help for PowerShell cmdlets
  • Troubleshooting
    • Unable to Run NCache PowerShell Cmdlets

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top