Erro encontrado ao executar um comando PS para reduzir o tamanho da pasta WinSxS no Windows Server 2008 R2

0

Estou tentando reduzir o tamanho do winSxS removendo alguns recursos por meio do Windows PowerShell. Eu usei o seguinte comando, mas ele está retornando uma mensagem de erro:

PS C:\Windows\system32> Get-WindowsFeature | Where-Object -FilterScript {$_.Installed -Eq $FALSE} | Uninstall-WindowsFea
ture  -Remove
The term 'Uninstall-WindowsFeature' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:101
+ Get-WindowsFeature | Where-Object -FilterScript {$_.Installed -Eq $FALSE} | Uninstall-WindowsFeature <<<<   -Remove
    + CategoryInfo          : ObjectNotFound: (Uninstall-WindowsFeature:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Tentei resolvê-lo importando o módulo usando este comando, mas não funcionou:

Import-Module ServerManager

Eu então tentei executar o primeiro comando acima novamente, mas ele falhou com o mesmo erro.

Alguma idéia?

    
por Mussa 04.12.2016 / 09:19

1 resposta

0

Uninstall-WindowsFeature Uninstalls specified Windows Server roles, role services, and features from a computer that is running Windows Server 2012. By adding the Remove parameter, also deletes feature files, or payload, from a computer. This cmdlet replaces Remove-WindowsFeature, the cmdlet that was used to uninstall roles, role services, and features in Windows Server 2008 R2.

Experimente Remove-WindowsFeature em vez de Uninstall-WindowsFeature

Lembre-se de que não há nenhum parâmetro -remove para esse cmdlet, então seu comando seria:

Get-WindowsFeature | Where-Object -FilterScript {$.Installed -eq $FALSE} | Remove-WindowsFeature

Não acho que isso reduza o tamanho da sua pasta do WinSxS. tente o Cleanmgr ferramenta em vez

    
por 05.12.2016 / 11:20

Tags