2107版的設定管理員 Cmdlet 程式庫變更

適用於:Configuration Manager (最新分支)

這些版本資訊摘要說明2107版中設定管理員 Cmdlet 程式庫的變更。

注意

設定管理員最新分支2103版是這些變更的基準。 如需詳細資訊,請參閱 2103 版的設定管理員 Cmdlet 程式庫變更

適用于應用程式部署類型的新 Cmdlet

管理應用程式部署類型的安裝行為

這組新的 Cmdlet 適用于應用程式部署類型的安裝行為。 如需安裝行為功能的一般資訊,請參閱 檢查執行中的可執行檔

Add-CMDeploymentTypeInstallBehavior

使用這個指令程式可新增至指定的部署類型。必須關閉才能讓應用程式安裝成功的可執行檔。

$msi_dt = Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)"
Add-CMDeploymentTypeInstallBehavior -InputObject $msi_dt -ExeFileName "notepad.exe" -DisplayName "Notepad"

如需詳細資訊,請參閱 CMDeploymentTypeInstallBehavior

Get-CMDeploymentTypeInstallBehavior

使用這個指令程式可從指定的部署類型取得需要關閉才能讓應用程式安裝成功的可執行檔案清單。

$msi_dt = Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)"
Get-CMDeploymentTypeInstallBehavior -InputObject $msi_dt

如需詳細資訊,請參閱 CMDeploymentTypeInstallBehavior

Remove-CMDeploymentTypeInstallBehavior

您可以使用這個指令程式,從指定的部署類型中移除需要關閉才能讓應用程式安裝成功的可執行檔。

$msi_dt = Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)"
Remove-CMDeploymentTypeInstallBehavior -InputObject $msi_dt -ExeFileName "notepad.exe"

For more information, see Remove-CMDeploymentTypeInstallBehavior.

Set-CMDeploymentTypeInstallBehavior

您可以使用這個指令程式來修改必須關閉才能讓應用程式安裝成功的可執行檔。

$msi_dt = Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)"
Set-CMDeploymentTypeInstallBehavior -InputObject $msi_dt -ExeFileName "notepad.exe" -NewExeFileName "calc.exe" -DisplayName "Calculator"

For more information, see Set-CMDeploymentTypeInstallBehavior.

管理應用程式部署類型的傳回碼

這組新的 Cmdlet 適用于應用程式部署類型的傳回碼。 如需更多一般資訊,請參閱 部署類型傳回碼

Add-CMDeploymentTypeReturnCode

使用此 Cmdlet 將傳回碼新增至支援的部署類型。

$msi_dt = Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)"
Add-CMDeploymentTypeReturnCode -InputObject $msi_dt -ReturnCode 1602 -Name "User cancel" -CodeType Failure -Description "The user cancelled the installation"

如需詳細資訊,請參閱 CMDeploymentTypeReturnCode

Get-CMDeploymentTypeReturnCode

使用這個指令程式可從指定的部署類型取得傳回碼的清單。

Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)" | Get-CMDeploymentTypeReturnCode

如需詳細資訊,請參閱 CMDeploymentTypeReturnCode

Remove-CMDeploymentTypeReturnCode

使用此 Cmdlet 可刪除指定部署類型的傳回碼。

$msi_dt = Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)"
Remove-CMDeploymentTypeReturnCode -InputObject $msi_dt -ReturnCode 1602

For more information, see Remove-CMDeploymentTypeReturnCode.

Set-CMDeploymentTypeReturnCode

使用這個 Cmdlet 修改指定部署類型的傳回碼。

$msi_dt = Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)"
Add-CMDeploymentTypeReturnCode -InputObject $msi_dt -ReturnCode 3010 -Name "Always reboot" -CodeType HardReboot -Description "Change soft reboot to hard reboot"

For more information, see Set-CMDeploymentTypeReturnCode.

其他新的 Cmdlet

Get-CMClientSettingDeployment

使用這個 Cmdlet 來取得自訂用戶端設定物件的部署。 您可以將此物件與 CMClientSettingDeployment搭配使用。

如需用戶端設定的詳細資訊,請參閱如何設定用戶端設定

$clientSetting =  Get-CMClientSetting -Name "Software Center customizations"
$clientSetting | Get-CMClientSettingDeployment

如需詳細資訊,請參閱 CMClientSettingDeployment

Get-CMDeploymentTypeDetectionClause

使用這個 Cmdlet 可從指定的部署類型取得偵測子句。

您可以使用此 Cmdlet 從一個應用程式取得偵測子句,並將其套用至另一個應用程式,例如:

$appMsi = Get-CMDeploymentType -ApplicationName "CenterApp" -DeploymentTypeName "InterDept - Windows Installer (.msi file)"

$clause1 = Get-CMDeploymentTypeDetectionClause -InputObject $appMsi

Set-CMScriptDeploymentType -ApplicationName "Configuration Manager console" -DeploymentTypeName "Install" -AddDetectionClause $clause1

如需詳細資訊,請參閱 CMDeploymentTypeDetectionClause

Get-CMPersistentUserSettingsGroup

使用這個 Cmdlet 取得您已儲存的全網站設定清單。 這些設定會在不同的裝置上執行。

例如,設定管理員作用中或已關閉的 主控台通知

如需詳細資訊,請參閱 CMPersistentUserSettingsGroup

Get-CMSoftwareUpdateContentInfo

使用這個 Cmdlet 取得軟體更新內容資訊。

$update = Get-CMSoftwareUpdate -ArticleId "5004237" -Fast
Get-CMSoftwareUpdateContentInfo -InputObject $update[1]

如需詳細資訊,請參閱 CMSoftwareUpdateContentInfo

Remove-CMPersistentUserSettingsGroup

使用此 Cmdlet 來重設整個網站的設定。

例如,您可以還原已解除的 設定管理員主控台通知 。 在您執行此 Cmdlet 並重新啟動設定管理員主控台之後,您會再次看到所有可用的通知。

For more information, see Remove-CMPersistentUserSettingsGroup.

已淘汰和移除的 Cmdlet

下列用來啟動部署的 Cmdlet 已淘汰,可能會在未來的版本中移除:

已取代的 Cmdlet 取代
Start-CMApplicationDeploymentSimulation 具有 模擬 參數的 新 CMApplicationDeployment
Start-CMClientSettingDeployment 新 CMClientSettingDeployment
Start-CMAntimalwarePolicyDeployment 新 CMAntimalwarePolicyDeployment

因為不再支援基礎功能,所以無法再使用下列 Cmdlet:

  • Add-CMApplicationCatalogWebServicePoint

  • Add-CMApplicationCatalogWebsitePoint

  • Get-CMApplicationCatalogWebServicePoint

  • Get-CMApplicationCatalogWebsitePoint

  • Remove-CMApplicationCatalogWebServicePoint

  • Remove-CMApplicationCatalogWebsitePoint

  • Set-CMApplicationCatalogWebsitePoint

  • Get-CMVhd

  • New-CMVhd

  • Remove-CMVhd

  • Set-CMVhd

Cmdlet 變更

此版本中的現有 Cmdlet 已進行下列變更。 變更可能是新功能或 bug 修正。 某些變更可能會中斷。 如果您使用此區段中所列的其中一個 Cmdlet 或功能區域,請仔細檢查變更,以瞭解它們可能會如何影響您的使用方式。

Add-CMDeviceCollectionDirectMembershipRule

如需詳細資訊,請參閱 CMDeviceCollectionDirectMembershipRule

已修正的錯誤 (Bug)

修正嘗試將數以千計的裝置新增為直接成員資格規則時發生的問題。

Add-CMDistributionPoint

如需詳細資訊,請參閱 Add-CMDistributionPoint

重大變更

預設的最小可用空間已從 50 MB 變更為 500 mb

Add-CMTaskSequenceStep

如需詳細資訊,請參閱 CMTaskSequenceStep

非中斷性變更

已移除不必要的參數 StepName

Disconnect-CMTrackedObject

如需詳細資訊,請參閱 中斷連線-CMTrackedObject

非中斷性變更

已新增此 Cmdlet 的別名 中斷連線-CMObject

Get-CMApplicationGroup

如需詳細資訊,請參閱 CMApplicationGroup

已修正的錯誤 (Bug)

修正了取得正確的應用程式群組路徑的問題。

Get-CMDeploymentStatusDetails

如需詳細資訊,請參閱 CMDeploymentStatusDetails

已修正的錯誤 (Bug)

修正了查詢準則,以避免可能的類型不相符問題。

Import-CMAntimalwarePolicy

如需詳細資訊,請參閱 CMAntimalwarePolicy

非中斷性變更

已新增具有潛在垃圾應用程式的 audit 模式原則支援。 如需詳細資訊,請參閱 潛在垃圾應用程式的 Audit 模式

Import-CMQuery

如需詳細資訊,請參閱 CMQuery

已修正的錯誤 (Bug)

修正瞭解除封鎖匯入函數的問題。

New-CMAdministrativeUser

如需詳細資訊,請參閱 CMAdministrativeUser

已修正的錯誤 (Bug)

修正使用者名稱為時的問題 me

New-CMApplicationDeployment

如需詳細資訊,請參閱 CMApplicationDeployment

非中斷性變更

已新增 AutoCloseExecutable 參數,以啟用安裝行為的應用程式部署設定。

New-CMCloudManagementGateway

如需詳細資訊,請參閱 New-CMCloudManagementGateway

重大變更

現在需要 ServiceCertPassword 參數。

New-CMMigrationJob

如需詳細資訊,請參閱 CMMigrationJob

已修正的錯誤 (Bug)

解除封鎖軟體發佈部署物件的遷移。

New-CMSecondarySite

如需詳細資訊,請參閱 new-cmsecondarysite

重大變更

已將預設的最小可用空間從 200 MB 變更為 500 mb

New-CMSoftwareUpdateAutoDeploymentRule

如需詳細資訊,請參閱 CMSoftwareUpdateAutoDeploymentRule

已修正的錯誤 (Bug)

修正了 Product 參數的問題。 如果有多個具有相同名稱的產品,則現在會選取所有產品。

New-CMSoftwareUpdateDeployment

如需詳細資訊,請參閱 CMSoftwareUpdateDeployment

非中斷性變更

已將 Description 別名新增至 Comment 參數。

New-CMTaskSequence

如需詳細資訊,請參閱 CMTaskSequence

非中斷性變更

  • Description 參數的最大長度擴充為 512 字元。

  • 新增了新的參數 HighPerformance ,以支援效能設定。

  • 已移除舊版 InstallationLicensingMode 參數。

  • 已移除 NewInstallOSImageVhd 參數集。

  • 已移除 InstallOperatingSystemImageVhd 參數。

New-CMTaskSequenceDeployment

如需詳細資訊,請參閱 CMTaskSequenceDeployment

已修正的錯誤 (Bug)

修正了高效能電源計劃的問題。

New-CMTSStepApplyDriverPackage (英文)

如需詳細資訊,請參閱 CMTSStepApplyDriverPackage

非中斷性變更

新增條件來驗證指定之 PackageId 的封裝。

New-CMTSStepApplyOperatingSystem (英文)

如需詳細資訊,請參閱 CMTSStepApplyOperatingSystem

已修正的錯誤 (Bug)

修正了 [destinationvariable 參數的驗證問題,以允許以底線 (開頭的值 _) 。

非中斷性變更

已新增 LayeredDriver 參數,以在作業系統部署期間支援多層鍵盤驅動程式。

New-CMTSStepUpgradeOperatingSystem (英文)

如需詳細資訊,請參閱 CMTSStepUpgradeOperatingSystem

非中斷性變更

新增了新的參數 SoftwareUpdate ,以指定 升級 OS 工作順序步驟的功能更新。

Publish-CMPrestageContent

For more information, see Publish-CMPrestageContent.

已修正的錯誤 (Bug)

已修正潛在的無效物件問題。

Remove-CMApplicationGroup

For more information, see Remove-CMApplicationGroup.

已修正的錯誤 (Bug)

修正了在使用管線時取得正確的應用程式群組路徑的問題。

Set-CMAntimalwarePolicy

For more information, see Set-CMAntimalwarePolicy.

非中斷性變更

加入參數 PuaProtection ,以支援潛在的垃圾應用程式。

Set-CMApplicationDeployment

For more information, see Set-CMApplicationDeployment.

非中斷性變更

已新增 AutoCloseExecutable 參數,以啟用安裝行為的應用程式部署設定。

Set-CMClientSetting

For more information, see Set-CMClientSetting.

非中斷性變更

已為 SoftwareMetering 參數新增有意義的取代訊息。

Set-CMClientSettingSoftwareUpdate

For more information, see Set-CMClientSettingSoftwareUpdate.

非中斷性變更

已新增參數 EnableWsusCertPinning 以支援憑證釘選。

Set-CMDeploymentType

For more information, see Set-CMDeploymentType.

已修正的錯誤 (Bug)

修正了 AddRequirement 參數新增規則的問題。

Set-CMMsiDeploymentType

For more information, see Set-CMMsiDeploymentType.

已修正的錯誤 (Bug)

根據安裝程式類型更新部署類型,以避免在變更內容位置時重設設定。

非中斷性變更

新增對 ContentLocation 參數指定資料夾路徑的支援。

Set-CMTaskSequence

For more information, see Set-CMTaskSequence.

非中斷性變更

新增了新的參數 HighPerformance ,以支援工作順序的效能設定。

Set-CMTSStepApplyDriverPackage (英文)

For more information, see Set-CMTSStepApplyDriverPackage.

非中斷性變更

新增條件來驗證指定之 PackageId 的封裝。

Set-CMTSStepApplyOperatingSystem (英文)

For more information, see Set-CMTSStepApplyOperatingSystem.

已修正的錯誤 (Bug)

修正了 Destination 參數的問題。

非中斷性變更

已新增 LayeredDriver 參數,以在作業系統部署期間支援多層鍵盤驅動程式。

Set-CMTSStepUpgradeOperatingSystem (英文)

For more information, see Set-CMTSStepUpgradeOperatingSystem.

非中斷性變更

新增了新的參數 SoftwareUpdate ,以指定 升級 OS 工作順序步驟的功能更新。

Start-CMDistributionPointUpgrade

For more information, see Start-CMDistributionPointUpgrade.

重大變更

將預設的最小可用空間設定為 500 MB

Update-CMDistributionPoint

如需詳細資訊,請參閱 >set-cmdistributionpoint

已修正的錯誤 (Bug)

修正了在安裝和卸載資料夾不同時更新內容的問題。

如何提供意見反應或報告問題

本文所述的許多修正和改進都是您的意見反應的結果。

若要傳送意見反應,請使用設定管理員主控台。 如需詳細資訊,請參閱 PowerShell 的意見反應。

若要提交新的功能要求,請參閱 UserVoice 上的 PowerShell 設定管理員群組。