
正文
判断Server Manager里面的Role是否已经安排
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
用InstallState来判断
function Check-DataDeduplication
{
Import-Module "ServerManager" -ErrorAction SilentlyContinue
if((Get-Module "ServerManager") -and (Get-WindowsFeature -name FS-Data-Deduplication -ErrorAction SilentlyContinue))
{
$scriptenv.IsExistDataDeduplicationEnv = (Get-WindowsFeature -name FS-Data-Deduplication).InstallState -eq [Microsoft.Windows.ServerManager.Commands.InstallState]::Installed
}
}






