共用方式為


Set-MasterDataServicesSystemSetting (PowerShell)

設定 Master Data Services 資料庫中指定的系統設定值。

語法

Set-MasterDataServicesSystemSetting [-Database] <Microsoft.MasterDataServices.Configuration.DatabaseInformation> 
        [-Setting] <Microsoft.MasterDataServices.Services.DataContracts.SystemSetting> [-SettingValue <String>]

說明

Set-MasterDataServicesSystemSetting 會設定 Master Data Services 資料庫中指定的系統設定值。

參數

-Database

Database 參數是來自 Get-MasterDataServicesDatabase 的資料庫資訊物件。這個物件包含要更新之 Master Data Services 資料庫的相關資訊。

必要項?

true

位置?

0

預設值

接受管線輸入

true (ByValue)

接受萬用字元?

false

-Setting

Setting 參數是系統設定物件,指定要更新之系統設定的名稱。

必要項?

true

位置?

1

預設值

接受管線輸入

true (ByValue)

接受萬用字元?

false

-SettingValue

SettingValue 參數是字串,指定要對系統設定進行設定的新值。如果未指定這個參數,則會使用 Setting 參數中的值。

必要項?

false

位置?

具名

預設值

接受管線輸入

true (ByPropertyName)

接受萬用字元?

false

輸入和輸出

輸入類型是可透過管道傳送至指令程式的物件類型。傳回類型是指令程式所傳回的物件類型。

輸入

Microsoft.MasterDataServices.Configuration.DatabaseInformation、Microsoft.MasterDataServices.Services.DataContracts.SystemSetting、System.String

輸入是指定系統設定新值的資料庫資訊物件、系統設定物件和字串。

輸出

無。

範例

透過管道傳送輸出以及使用變數

這個範例透過管道將資料庫伺服器資訊物件從 Get-MasterDataServicesDatabaseServerInformation 傳送到 Set-MasterDataServicesSystemSetting。它會取得 [每批次的資料列] 系統設定的目前值,然後更新 Master Data Services 資料庫中的值。

C:\PS> # Get the database server information object
$dbInfo = Get-MasterDataServicesDatabaseServerInformation 
    -ConnectionString 'Data Source=MyServer\MyInstance;Initial Catalog=;Integrated Security=True;User ID=;Password=' | 
    Get-MasterDataServicesDatabase -DatabaseName 'MyDatabase'; 

# Retrieve the current RowsPerBatch system setting
$rowsPerBatchSetting = $dbInfo | Get-MasterDataServicesSystemSettings | where { $_.DisplayName -eq 'Rows Per Batch'};

# Display the current value of RowsPerBatch
write-host The current setting for RowsPerBatch is $rowsPerBatchSetting.SettingValue;

# Pipe the dbInfo object and set the setting value using the SettingValue parameter
$dbInfo | Set-MasterDataServicesSystemSetting  -Setting $rowsPerBatchSetting -SettingValue '60';

# Retrieve the setting again to see if it was properly updated.
$newRowsPerBatch = $dbInfo | Get-MasterDataServicesSystemSettings | where { $_.DisplayName -eq 'Rows Per Batch' };

# Display the new value of RowsPerBatch.
write-host The new setting for RowsPerBatch is $rowsPerBatchSetting.SettingValue;