Starting with Windows Server 2012 R2 and Windows 8.1, PowerShell ships with many useful cmdlets for client and server configuration. This comes handy as some settings can no longer be controlled via UI. 从 Windows Server 2012 R2 和 Windows 8.1 开始,随着 PowerShell 发布了许多有用的客户端和服务器配置 cmdlet。这些 cmdlet 十分趁手,因为一些设置可以不再通过 UI 来控制。
例如,要改变网络的类型,只需要以管理员身份运行以下代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
PS> Get-NetConnectionProfile
Name : internet-cafe InterfaceAlias : WiFi InterfaceIndex : 13 NetworkCategory : Private IPv4Connectivity : Internet IPv6Connectivity : Internet
PS> Get-NetConnectionProfile | Set-NetConnectionProfile-NetworkCategory Public -WhatIf What if:
PowerShell 可能是最简单的移除预装 Windows 10 APP 的方法。如果您知道想要移除的应用程序名称,只需要以管理员身份打开 PowerShell,然后像这样移除 APP:
1 2 3 4
PS> Get-AppxPackage *bingweather* | Remove-AppxPackage-WhatIf What if: Performing the operation "Remove package" on target "Microsoft.BingWeather_4.20.1102.0_x64__8wekyb3d8bbwe".