
De vez em quando eu preparo um novo PC para alguém e pensei que poderia liberar programas e anúncios do menu e começar a usar o PowerShell. Funcionou, mas apenas parcialmente. Consegui liberar programas como Calendar & Weather, mas não tenho ideia de como me livrar de anúncios de jogos da Windows Store, como Asphalt 8: Airborne:
Que nome devo incluir em um script para liberar essa coisa (e similares)?
Aqui está o script que eu uso:
function Pin-App { param(
[string]$appname,
[switch]$unpin
)
try{
if ($unpin.IsPresent){
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Von "Start" lösen|Unpin from Start'} | %{$_.DoIt()}
return "App '$appname' unpinned from Start"
}else{
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'An "Start" anheften|Pin to Start'} | %{$_.DoIt()}
return "App '$appname' pinned to Start"
}
}catch{
Write-Error "Error Pinning/Unpinning App! (App-Name correct?)"
}
}
Pin-App "Mail" -unpin
Pin-App "Store" -unpin
Pin-App "Calendar" -unpin
Pin-App "Microsoft Edge" -unpin
Pin-App "Photos" -unpin
Pin-App "Cortana" -unpin
Pin-App "Weather" -unpin
Pin-App "Phone Companion" -unpin
Pin-App "Twitter" -unpin
Pin-App "Skype Video" -unpin
Pin-App "Candy Crush Soda Saga" -unpin
Pin-App "xbox" -unpin
Pin-App "Groove music" -unpin
Pin-App "films & tv" -unpin
Pin-App "microsoft solitaire collection" -unpin
Pin-App "money" -unpin
Pin-App "get office" -unpin
Pin-App "onenote" -unpin
Pin-App "news" -unpin
Pin-App "Asphalt 8: Airborne" -unpin
Pin-App "This PC" -pin
Responder1
Se quiser implantar um menu inicial padronizado, você pode usar Export-StartLayout
e Import-StartLayout
:
- Configure manualmente o menu Iniciar em uma máquina de teste como você deseja.
- Exporte esse layout para um arquivo XML com extensão
Export-StartLayout
. - Importe esse arquivo nos outros computadores com extensão
Import-StartLayout
.
Há mais detalhes da Microsoft aqui:
https://blogs.technet.microsoft.com/deploymentguys/2016/03/07/windows-10-start-layout-customization/
Responder2
Isso é algo simples que escrevi com o PowerShell para enviar meu layout de menu inicial personalizado para o Windows 10 usando MDT. Ele começa com o MDT implantando o XML na pasta temporária durante a implantação.
Clear-Host
# file path that the xml must live in
$filepath = "C:\users\default\AppData\Local\Microsoft\Windows\Shell"
# xml files that were copied to local machine
$startxmlorig = "C:\Windows\Temp\startandtaskbar.xml"
$layoutmod = "C:\Windows\Temp\LayoutModification.xml"
# test the path to see if it exists if yes then copy xmls to correct folder on if not then create the path and copy the xml files to the correct path.
if (!(Test-Path -Path $filepath)) {
Copy-Item -Path $startxmlorig -Destination $filepath
Copy-Item -Path $layoutmod -Destination $filepath
} else {
New-Item -Force -ItemType Directory -Path $filepath
Copy-Item -Path $startxmlorig -Destination $filepath
Copy-Item -Path $layoutmod -Destination $filepath`