NCache 使用户能够创建缓存数据的备份。 Export-CacheData cmdlet 将缓存中当前存在的所有项目备份到用户提供的网络或本地路径。 相似地, NCache 提供 Import-CacheData cmdlet,使用户能够将放置在特定路径的数据导入缓存。
注意:您可能无法运行 NCache PowerShell cmdlet(如果环境变量) PSModulePath 安装后没有刷新。 导入 NCache PowerShell 模块 (ncacheps.dll) 在以下位置找到:
%NCHOME%\bin\工具\ncacheps
您可以将缓存内容与依赖程序集的路径一起导出到您指定的任何路径。 用于此目的的 PowerShell cmdlet 是:
Export-CacheData [-Name] [-NoLogo] [-Password] [-Path] [-Port] [-UserId]
该命令的强制参数解释如下:
示例: 以下命令将缓存的所有项目备份到指定路径:
Export-CacheData -Name demoCache -AssemblyPath C:\assembly-folder -Path C:\recovery-path
您可以将数据导入特定路径上的缓存。 用于此目的的 PowerShell cmdlet 是:
Import-CacheData [-Name] [-AssemblyPath] [-BulkSize] [-ErrorThreshhold] [-Expiry] [-NoLogo] [-Password] [-Path] [-UserId]
该命令的强制参数解释如下:
示例: 此命令将位于指定路径上的备份源中的数据导入到缓存中,包括相关的程序集文件。
Import-CacheData -Name demoCache -AssemblyPath C:\assembly-folder -Path C:\recovery-path
如需更多详细信息,请参阅 PowerShell 参考 我们的网站上。