Add-ClientCacheRefDataType
Add-ClientCacheRefDataType cmdlet is used to define Reference Data Types for a Full-Data Client Cache. By registering specific data classes (via a DLL or JSON files), administrators enable NCache to maintain a complete, locally residing dataset for those types at the application tier.
Add-ClientCacheRefDataType -CacheName -AssemblyPath `
-Datatype [-NoLogo] `
[-Port] [-Server] `
[-TlsCertPath] [-TlsCertPassword] `
[-Credentials]
Examples
- This command adds the class Data.Customer as a reference data type for the Full-Data Client Cache configured for defaultCache.
Add-ClientCacheRefDataType -CacheName defaultCache -AssemblyPath C:\Data.dll `
-Datatype Data.Customer
- This command adds the classes Data.Customer and Data.Product as reference data types for the Full-Data Client Cache configured for defaultCache on server 20.200.20.11.
Add-ClientCacheRefDataType -CacheName defaultCache -AssemblyPath C:\Data.dll `
-Datatype Data.Customer'$'Data.Product `
-Server 20.200.20.11
- This command adds the classes Data.Customer and Data.Product as reference data types for the Full-Data Client Cache configured for defaultCache on server 20.200.20.11. In this case, the
AssemblyPathpoints to a JSON file.
Add-ClientCacheRefDataType -CacheName defaultCache -AssemblyPath C:\Data.json `
-Datatype Data.Customer'$'Data.Product `
-Server 20.200.20.11
- This command adds the class Data.Customer as reference data type for the Full-Data Client Cache configured for defaultCache on the local server using security credentials.
Add-ClientCacheRefDataType -CacheName defaultCache -AssemblyPath C:\Data.dll `
-Datatype Data.Customer -Credentials(Get-Credential john_smith)
- This command adds the classes Data.Customer and Data.Product as reference data types for the Full-Data Client Cache configured for defaultCache on server 20.200.20.11 using a client PEM certificate and password for mutual TLS (mTLS) authentication.
Add-ClientCacheRefDataType -CacheName defaultCache -AssemblyPath C:\Data.dll `
-Datatype Data.Customer'$'Data.Product `
-Server 20.200.20.11 -TlsCertPath "C:\certs\client.pem" `
-TlsCertPassword "clientKeyPassword"
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 of the assembly that contains classes to be configured as reference data types. | - |
-CacheName* |
<String> |
Specifies the name of the clustered cache with which the Full-Data Client Cache is configured. NOTE: The cache must already exist on the source server. |
- |
-Datatype* |
<String> |
Specifies the names of the reference data types configured for Full-Data Client Cache. Multiple data types should be '$' separated, e.g., Data.Customer'$'Data.Product. | - |
-Port |
<Integer> |
Specifies the server port where NCache Service is listening. | 9803 |
-Server |
<String> |
Specifies the name or IP address of the NCache server where the clustered cache is registered. | IP of local machine |
-Credentials |
<pscredential> |
Specifies the user credentials used to authorize the user for this operation. It is required in case security is enabled on cache server. The password must be the same as the active directory user password. The user id must be the same as the active directory user id. | - |
-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> |
Specifies the password for the encrypted private key in the PEM file provided through -TlsCertPath. Omit this parameter if the private key is not encrypted. The password is used only for the current command and is not saved in the NCache server configuration. |
- |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |