Condividi tramite


Set-MasterDataServicesSystemSetting (PowerShell)

Imposta il valore di un'impostazione di sistema specificata in un database Master Data Services.

Sintassi

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

Descrizione

Set-MasterDataServicesSystemSetting imposta il valore di un'impostazione di sistema specificata in un database Master Data Services.

Parametri

-Database

Il parametro Database è un oggetto informazioni sul database da Get-MasterDataServicesDatabase. L'oggetto contiene informazioni sul database Master Data Services da aggiornare.

Obbligatorio?

true

Posizione?

0

Valore predefinito

none

Accettare input da pipeline?

true (ByValue)

Accettare caratteri jolly?

false

-Setting

Il parametro Setting è un oggetto impostazione di sistema che specifica il nome dell'impostazione di sistema da aggiornare.

Obbligatorio?

true

Posizione?

1

Valore predefinito

none

Accettare input da pipeline?

true (ByValue)

Accettare caratteri jolly?

false

- SettingValue

Il parametro SettingValue è una stringa che specifica il nuovo valore da importare per l'impostazione di sistema. Se questo parametro non è specificato, viene utilizzato il valore nel parametro Setting.

Obbligatorio?

false

Posizione?

named

Valore predefinito

none

Accettare input da pipeline?

true (ByPropertyName)

Accettare caratteri jolly?

false

Input e output

Il tipo di input è il tipo degli oggetti che è possibile reindirizzare al cmdlet. Il tipo restituito è il tipo di oggetti restituito dal cmdlet.

Input

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

L'input è un oggetto informazioni sul database, un oggetto impostazione di sistema e una stringa per specificare un nuovo valore per l'impostazione di sistema.

Output

Nessuno.

Esempi

Inoltro tramite pipe di output e utilizzo di variabili

In questo esempio l'oggetto informazioni sul server database viene inoltrato tramite pipe da Get-MasterDataServicesDatabaseServerInformation a Set-MasterDataServicesSystemSetting. Ottiene il valore corrente dell'impostazione di sistema Righe per batch, quindi aggiorna il valore nel database 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;