Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Script:
# Verifica se o recurso Microsoft Print to PDF já está instalado
$printerInstalled = Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Printing-PrintToPDFServices-Features" }
if ($printerInstalled.State -eq "Enabled") {
Write-Host "O recurso Microsoft Print to PDF já está instalado."
} else {
Write-Host "Instalando o recurso Microsoft Print to PDF..."
Enable-WindowsOptionalFeature -Online -FeatureName Printing-PrintToPDFServices-Features -All
Write-Host "Instalação concluída com sucesso."
}
Como Executar o Script:
.ps1
, por exemplo, InstalarPrintToPDF.ps1
.cd
. Por exemplo:
cd C:\Caminho\Para\Seu\Script
.\InstalarPrintToPDF.ps1