Add-StartupLoader
The Add-StartupLoader PowerShell cmdlet enables the users to configure Startup Cache Loader for the cache which populates the cache with critical datasets at startup. It also allows the user to configure Cache Refresher that refreshes the preloaded data after a specified time interval.
Warning
Make sure that the cache has been stopped before proceeding to execute this cmdlet.
Add-StartupLoader -AssemblyPath -CacheName `
-Class [-Parameters] `
[-Server] [-Port] `
[-Retries] [-RetryInterval] `
[-TlsCertPath] [-TlsCertPassword] `
[-RefreshInterval] [-PollForDatasetsToRefresh] `
[-NoDeploy] [-DependentAssemblyPath] `
[-NoLogo] [-Credentials]
Examples
- This command configures a Startup Cache Loader for a cache named defaultCache. The assemblies to be deployed are placed at the specified path and the default port 9803.
Add-StartupLoader -CacheName defaultCache -AssemblyPath C:\Loader.dll `
-Class StartupLoader.Loader
- This command configures a Startup Cache Loader for a cache named defaultCache. The assemblies to be deployed are placed at the specified path and the default port 9803. The
-NoDeployparameter specifies that no assembly should be deployed.
Add-StartupLoader -CacheName defaultCache -AssemblyPath C:\Loader.dll `
-Class StartupLoader.Loader -NoDeploy
- This command configures a Startup Loader for a cache named defaultCache on the server node 20.200.20.11.
Add-StartupLoader -CacheName defaultCache -AssemblyPath C:\Loader.dll `
-Class StartupLoader.Loader -Server 20.200.20.11 `
- This command configures a Startup Loader for a cache named defaultCache on the server node 20.200.20.11 and specifies a directory for all required secondary libraries.
Add-StartupLoader -CacheName defaultCache -AssemblyPath C:\Loader.dll `
-Class StartupLoader.Loader -Server 20.200.20.11 `
-DependentAssemblyPath C:\Dependencies\
- This command configures a Cache Loader for defaultCache on server 20.200.20.11 with a refresh interval set to 1200 seconds. Retry Interval has been set to 0, meaning the loader will not wait between any failed operation retry attempts.
Add-StartupLoader -CacheName defaultCache -AssemblyPath C:\Loader.dll `
-Class StartupLoader.Loader -Server 20.200.20.11 `
-RefreshInterval 1200 -RetryInterval 0
- This command configures a Cache Loader for defaultCache on server 20.200.20.11 and additionally polls for datasets to refresh at every refresh interval.
Add-StartupLoader -CacheName defaultCache -AssemblyPath C:\Loader.dll `
-Class StartupLoader.Loader -Server 20.200.20.11 `
-PollForDatasetsToRefresh
- This command configures StartupLoader.Loader from
C:\Provider.dllas the startup loader for defaultCache on the specified server with mutual TLS (mTLS) enabled. It runs from a machine where NCache is not installed and usesC:\certs\client.pemto authenticate the machine running the cmdlet. The-TlsCertPasswordparameter decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
Add-StartupLoader -CacheName defaultCache -AssemblyPath C:\Provider.dll `
-Class StartupLoader.Loader -Server 20.200.20.11
-TlsCertPath "C:\certs\client.pem" -TlsCertPassword "clientKeyPassword"
- This command configures a Startup Cache Loader for a cache named defaultCache, using security credentials.
Add-StartupLoader -CacheName defaultCache -AssemblyPath C:\Loader.dll `
-Class StartupLoader.Loader -Credentials(Get-Credential john_smith)
Properties
Note
The parameters with asterisk (*) on their names are the required parameters and the rest are optional.
| Parameters | Data Types | Description | Default Value |
|---|---|---|---|
-AssemblyPath* |
<String> |
Specifies the path where the assembly is placed which is to be configured as a Startup Loader/Refresher. | - |
-CacheName* |
<String> |
Specifies the name of the cache for which Cache Loader is to be configured. NOTE: The cache must already exist on the source server. |
- |
-Class* |
<String> |
Specifies the fully qualified class name from the Startup Loader which implements ICacheLoader. |
- |
-Parameters |
<String> |
Specifies the list of the parameters which are to be passed to the Cache Loader separated by ‘$’. | - |
-Server |
<String> |
Specifies a server name where the NCache Service is running and a cache with the specified cache-name is registered. | IP of local machine |
-Port |
<Integer> |
Specifies the server port where the NCache Service is listening. | 9803 |
-Retries |
<Integer> |
Specifies the number of retries for loading data in the cache in case of failed operations. | - |
-RetryInterval |
<Integer> |
Specifies the interval to wait before each failed operation retry. | 0 |
-RefreshInterval |
<Integer> |
Specifies the refresh interval after which the cache polls to observe new datasets that needs to be refreshed from datasource. | 900 seconds |
-PollForDatasetsToRefresh |
<SwitchParameter> |
Refresh datasets in real time by calling GetDatasetsToRefresh method from the configured Cache Loader assembly. |
|
-NoDeploy |
<SwitchParameter> |
Specifies if no assembly should be deployed. | False |
-DependentAssemblyPath |
<String> |
Specifies the path where dependent assemblies or folders are placed. | - |
-TlsCertPath |
<string> |
Specifies the path to the client PEM certificate used to authenticate this cmdlet when the target NCache server requires Mutual TLS. This parameter is required for Mutual TLS connections even when the cmdlet runs on an NCache server. The PEM file must contain the private key, leaf certificate, and any intermediate certificates. Relative paths are resolved against the current PowerShell location, and the file must exist. You can generate a client certificate using New-NCacheTlsCertificate. | - |
-TlsCertPassword |
<string> |
Password used to load the encrypted private key in the PEM file specified by -TlsCertPath. Required only when the private key is password-protected. Not needed for an unencrypted private key. The password is used only to load the client certificate for the current command's connections. It is not saved in the NCache server configuration. |
- |
-Credentials |
<pscredential> |
Specifies the user credentials required to authorize access for the specified operation. These credentials should belong to a user with the appropriate permissions at the node. | - |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |