小编Roy*_*tty的帖子

如何使用 Powershell 取消固定 Windows 10 开始菜单广告

我不时为某人准备一台新 PC,并认为我可以使用 powershell 从菜单开始取消固定程序和广告。它起作用了,但只是部分起作用。我能够取消固定日历和天气等程序,但不知道如何摆脱像 Asphalt 8: Airborne 这样的 Windows 商店游戏广告:

在此处输入图片说明

我应该在脚本中包含什么名称来取消固定那个东西(和类似的东西)?

这是我使用的脚本:

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 …
Run Code Online (Sandbox Code Playgroud)

windows powershell windows-10

5
推荐指数
1
解决办法
8178
查看次数

标签 统计

powershell ×1

windows ×1

windows-10 ×1