Set-SCCustomPlacementRule
在主機群組的放置設定中調整自訂放置規則。
Syntax
Set-SCCustomPlacementRule
-CustomPlacementRule <CustomPlacementRule>
[-MustNotMatch]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-SCCustomPlacementRule
-CustomPlacementRule <CustomPlacementRule>
[-MustMatch]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-SCCustomPlacementRule
-CustomPlacementRule <CustomPlacementRule>
[-ShouldNotMatch]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-SCCustomPlacementRule
-CustomPlacementRule <CustomPlacementRule>
[-ShouldMatch]
[-VMMServer <ServerConnection>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Set-SCCustomPlacementRule Cmdlet 會在主機群組的放置設定中修改現有的自訂放置規則。
範例
範例 1:在主機群組的放置設定中修改現有的自訂放置規則
PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $PlacementConfig = Get-SCPlacementConfiguration -VMHostGroup $HostGroup
PS C:\> $CPRule = Get-SCCustomPlacementRule -PlacementConfiguration $PlacementConfig | where {$_.CustomPropertyName -eq "Charge Code"}
PS C:\> Set-SCCustomPlacementRule -MustMatch -CustomPlacementRule $CPRule
第一個命令會取得名為 HostGroup01 的主機群組物件,並將物件儲存在$HostGroup變數中。
第二個命令會取得儲存在 $HostGroup 之主機群組的放置組態物件,並將物件放在$PlacementConfig變數中。
第三個命令會取得名為 Charge Code 的自訂放置規則物件,並將物件儲存在$CPRule變數中。
最後一個命令會將自訂屬性 Charge Code 的自訂放置規則強制為「必須相符」規則。
參數
-Confirm
在執行 Cmdlet 前提示您確認。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CustomPlacementRule
指定自訂放置規則物件。
Type: | CustomPlacementRule |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-JobVariable
指定追蹤工作進度,並將工作進度存放在這個參數命名的變數中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MustMatch
表示虛擬機器的 屬性值必須符合主機。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MustNotMatch
表示虛擬機器的 屬性值不得與主機相符。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定觸發此動作 (PRO 提示) 效能和資源優化提示的識別碼。 此參數可讓您稽核 PRO 秘訣。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
表示作業會以非同步方式執行,讓控制項立即返回命令殼層。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ShouldMatch
指出虛擬機器的 屬性值應該符合主機。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ShouldNotMatch
表示虛擬機器的 屬性值不應與主機相符。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定 VMM 伺服器物件。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
顯示執行 Cmdlet 後會發生的情況。 Cmdlet 並不會執行。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |