Skip to content

Commit 5036244

Browse files
committed
Update UninstallFaxAndScan for 2004
1 parent 785c8ab commit 5036244

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Win10.psm1

+12-4
Original file line numberDiff line numberDiff line change
@@ -3523,16 +3523,24 @@ Function AddFaxPrinter {
35233523
Add-Printer -Name "Fax" -DriverName "Microsoft Shared Fax Driver" -PortName "SHRFAX:" -ErrorAction SilentlyContinue
35243524
}
35253525

3526-
# Uninstall Windows Fax and Scan Services - Not applicable since 2004. Not applicable to Server
3526+
# Uninstall Windows Fax and Scan Services - Not applicable to Server
35273527
Function UninstallFaxAndScan {
35283528
Write-Output "Uninstalling Windows Fax and Scan Services..."
3529-
Disable-WindowsOptionalFeature -Online -FeatureName "FaxServicesClientPackage" -NoRestart -WarningAction SilentlyContinue | Out-Null
3529+
If ([System.Environment]::OSVersion.Version.Build -ge 19041) {
3530+
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Print.Fax.Scan*" } | Remove-WindowsCapability -Online | Out-Null
3531+
} Else {
3532+
Disable-WindowsOptionalFeature -Online -FeatureName "FaxServicesClientPackage" -NoRestart -WarningAction SilentlyContinue | Out-Null
3533+
}
35303534
}
35313535

3532-
# Install Windows Fax and Scan Services - Not applicable since 2004. Not applicable to Server
3536+
# Install Windows Fax and Scan Services - Not applicable to Server
35333537
Function InstallFaxAndScan {
35343538
Write-Output "Installing Windows Fax and Scan Services..."
3535-
Enable-WindowsOptionalFeature -Online -FeatureName "FaxServicesClientPackage" -NoRestart -WarningAction SilentlyContinue | Out-Null
3539+
If ([System.Environment]::OSVersion.Version.Build -ge 19041) {
3540+
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Print.Fax.Scan*" } | Add-WindowsCapability -Online | Out-Null
3541+
} Else {
3542+
Enable-WindowsOptionalFeature -Online -FeatureName "FaxServicesClientPackage" -NoRestart -WarningAction SilentlyContinue | Out-Null
3543+
}
35363544
}
35373545

35383546
##########

0 commit comments

Comments
 (0)