So lösen Sie Anzeigen im Windows 10-Startmenü mit Powershell

So lösen Sie Anzeigen im Windows 10-Startmenü mit Powershell

Von Zeit zu Zeit bereite ich einen neuen PC für jemanden vor und dachte, ich könnte Programme und Anzeigen mithilfe von Powershell vom Menüstart entfernen. Das funktionierte, aber nur teilweise. Ich konnte Programme wie Kalender und Wetter entfernen, habe aber keine Ahnung, wie ich Anzeigen von Spielen wie Asphalt 8: Airborne aus dem Windows Store entfernen kann:

Bildbeschreibung hier eingeben

Welchen Namen sollte ich in ein Skript aufnehmen, um dieses Ding (und ähnliches) zu lösen?

Hier ist das Skript, das ich verwende:

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

Antwort1

Wenn Sie ein standardisiertes Startmenü bereitstellen möchten, können Sie Export-StartLayoutFolgendes verwenden Import-StartLayout:

  1. Richten Sie das Startmenü auf einem Testcomputer manuell nach Ihren Wünschen ein.
  2. Exportieren Sie dieses Layout mit in eine XML-Datei Export-StartLayout.
  3. Importieren Sie diese Datei auf den anderen Computern mit Import-StartLayout.

Weitere Details gibt es von Microsoft hier:

https://blogs.technet.microsoft.com/deploymentguys/2016/03/07/windows-10-start-layout-customization/

Antwort2

Dies ist etwas Einfaches, das ich mit PowerShell geschrieben habe, um mein benutzerdefiniertes Startmenü-Layout mithilfe von MDT auf Windows 10 zu übertragen. Es beginnt damit, dass MDT das XML während der Bereitstellung im temporären Ordner bereitstellt.

    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`

verwandte Informationen