Add-LoaderDataset
This PowerShell cmdlet enables the users to add specific datasets to a cache with Cache Loader and Refresher configured.
Warning
Make sure that the cache has been stopped before proceeding to execute this cmdlet.
Add-LoaderDataset -CacheName [-Server] `
[-Port] -Dataset `
[-ScheduleOption] [-ScheduleExpression] `
[-Credentials] [-RefreshInterval] `
[-TlsCertPath] [-TlsCertPassword] `
[-NoLogo]
Examples
- This command adds dataset on cache loader/refresher configured defaultCache that will refresh itself after an interval of 5 minutes from cache start.
Add-LoaderDataset -Dataset order -CacheName defaultCache `
-ScheduleExpression 0:00:00:05 -ScheduleOption DailyInterval
- This command adds dataset on cache loader/refresher configured defaultCache that will refresh itself at 03:05 am.
Add-LoaderDataset -Dataset order -CacheName defaultCache `
-ScheduleExpression 0:00:03:05 -ScheduleOption DailyTime
- This command adds dataset on cache loader/refresher configured defaultCache that will refresh itself at 03:05 pm.
Add-LoaderDataset -Dataset order -CacheName defaultCache `
-ScheduleExpression 0:00:15:05 -ScheduleOption DailyTime
- This command adds dataset on cache loader/refresher configured defaultCache that will refresh itself on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday every week at 12:00 pm.
Add-LoaderDataset -Dataset order -CacheName defaultCache `
-ScheduleExpression '0:1,2,3,4,5,6:12:00' -ScheduleOption Weekly
- This command adds dataset on cache loader/refresher configured defaultCache that will refresh itself on 1st, 2nd, 3rd, 4th, Last Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday of every month at 12:00 pm. The Refresh Interval has been set to 900 seconds.
Add-LoaderDataset -Dataset order -CacheName defaultCache `
-ScheduleExpression '1,2,3,4,L:1,2,3,4,5,6,7:12:00' -ScheduleOption Monthly `
-RefreshInterval 900
- This command adds the order loader dataset to defaultCache with a DailyInterval schedule of 0:00:00:05, using mutual TLS (mTLS). It runs from a machine where NCache is not installed and uses
C:\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-LoaderDataset -Dataset order -CacheName defaultCache `
-ScheduleExpression 0:00:00:05 -ScheduleOption DailyInterval `
-TlsCertPath "C:\certs\client.pem" -TlsCertPassword "clientKeyPassword"
- This command adds dataset on cache loader/refresher configured defaultCache that will refresh itself after an interval of 5 minutes from cache start, using security credentials.
Add-LoaderDataset -Dataset order -CacheName defaultCache `
-ScheduleExpression 0:00:00:05 -ScheduleOption DailyInterval `
-Credentials(Get-Credential john_smith)
Properties
Note
The parameters with asterisk (*) with their names are the required parameters and the rest are optional.
| Parameters | Data Types | Description | Default Value |
|---|---|---|---|
-CacheName* |
<String> |
Specifies the cache name that is configured with dataset on the server. NOTE: The cache must already exist on the source server. |
- |
-Server |
<String> |
Specifies the 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 port on which NCache Service is listening. | 9817 |
-Dataset* |
<String> |
Specifies the name of the dataset that needs to be configured. | - |
-ScheduleOption |
<String> |
Specifies option for scheduling the data. The options are: - DailyInterval - DailyTime - Weekly - Monthly |
- |
-ScheduleExpression |
<String> |
Specifies the schedule at which datasets need to be refreshed. The format for specifying the ScheduleExpression is Week:Days/Weekdays:Hours:Minutes | - |
-RefreshInterval |
<Integer> |
Specifies the refresh interval after which the cache polls to observe new datasets that need to be refreshed from datasource. | 900 seconds |
-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. | - |
-TlsCertPath |
<string> |
Path to the client PEM certificate used to authenticate the machine running the NCache PowerShell cmdlet when connecting to an NCache server with mutual TLS (mTLS) enabled. The PEM file must contain the private key, leaf certificate, and any intermediate certificates. You can generate a certificate using New-NCacheTlsCertificate. This parameter is required when running the PowerShell module from a machine where NCache is not installed and the server requires mTLS. On a machine with an NCache server installation, the node's own certificate is used automatically. Relative paths are resolved against the current PowerShell location, and the file must exist. To configure the certificate presented by the server, use -CustomCertificatePath. |
- |
-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. |
- |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | False |