Add windows features windows 10

Включение и отключение компонентов Windows 10

Как известно, Windows 10 отличается набором компонентов от предыдущих версий операционных систем Windows. Зачастую требуется их включить или выключить, чтобы они не потребляли системные ресурсы, да и просто не мешали. В этой статье мы рассмотрим как это сделать быстрее и эффективнее.

Начнем с того, что существует два основных способа работы с компонентами (они еще называются features) — утилита DISM и командлеты Powershell. И то и другое встроено в Windows 10, в отличие от Windows 7, где dism можно было добавить или установив пакет Windows ADK, или руками скопировав dism.exe с другого компьютера.

Сразу отмечу, что утилиту dism и среду powershell для работы с системой необходимо запускать от имени администратора, даже если ваш аккаунт уже находится в группе локальных админов. Итак, вы или находите cmd или windows powershell в меню и, кликнув правой кнопкой мышки, выбираете «Запуск от имени администратора».

Capabilities — это дополнительные возможности, которые расширяют возможности интерфейса и увеличивают удобство пользователя. Среди них — Language packs, наборы шрифтов. Да, Microsoft удалил часть нестандартных шрифтов, которые теперь вынесены в опциональные компоненты. Скачать эти компоненты можно в виде ISO файла с сайта Volume Licensing Service Center или напрямую через Internet и графический интерфейс Windows. Такую концепцию Microsoft назвала Features on Demand (FOD). Их в более ранних версия Windows не было.

Работаем с Windows Features

Итак, список установленных компонентов можно посмотреть командой

Dism /online /Get-Features

Вот как в Powershell можно получить список всех компонентов командлетами Get-WindowsFeature (для Windows Server) или Get-WindowsOptionalFeature (Windows 10):

Чтобы получить список отключенных компонентов, введите:

Этот список также можно вывести в файл (для windows Server):

Посмотрев список названий и их состояние, можно использовать эти названия для того, чтобы компоненты включить или выключить:

Dism /online /Enable-Feature /FeatureName:TFTP /All

ключ /All позволяет включить также все дочерние компоненты;

Установка компонентов через Powershell выполняется командой Enable-WindowsOptionalFeature.

Dism /online /Disable-Feature /FeatureName:TFTP

Обратите внимание, некоторые фичи имеют разные названия в Windows 7 и Windows 10. Например, RSAT в Windows 7 — это RemoteServerAdministrationTools, а в Windows 10 — RSATclient.

Управление Features on Demand (FOD)

Если вы устанавливаете их через графический интерфейс, то вам необходимо пройти “System –> App & features –> Manage optional features” и нажать знак + напротив необходимых компонентов.

Чтобы сделать это автоматизированно через командную строку, наберите чтобы получить список доступных компонентов:

DISM.EXE /Online /Get-Capabilities

DISM.EXE /Online /Add-Capability /CapabilityName:NetFx3

Если же у вас нет доступа в Интернет, то есть выход. Итак, вы скачиваете ISO образ диска с FOD компонентами с сайта Volume Licensing Service Center. Файлы будут разные для разных релизов Windows 10 — 1511, 1607, 1703, 1709. Важно помнить, что компоненты одного релиза не подходят к другому. Если вы сделаете in-place upgrade (установка одного релиза поверх другого через обновление), то несовместимые установленные компоненты будут удалены без вашего желания! Да, Microsoft удаляет то, что считает несовместимым при обновлении.

Так вот, ISO файл содержит набор неизвестных и сложных для понимания файлов с расширением cab. Вот чудесный файлик на сайта Microsoft, который обясняет назначение каждого файла. Итак, существуют следующие типы FOD:

Итак, для добавления таких FOD компонентов, используйте команды вида (замените имя компонента):

Dism /Online /Add-Capability /CapabilityName:Language.Basic

Dism /Online /Remove-Capability /CapabilityName:Language.Basic

Установка и переустановка пакетов языков (Language Interface Packs, LIP)

Язык интерфейса Windows можно поменять, установив так называемые LIP. ранее они назывались MUI (Multi user interface). Файлы LIP выглядят так: Microsoft-Windows-Client-Language-Pack_x64_es-es.cab для испанского языка. Выглядеть установка будет примерно так:

Dism /Add-Package /online /PackagePath:»C:\Languages\Microsoft-Windows-Client-Language-Pack_x64_fr-fr.cab»

Dism /Remove-Package /online /PackageName:Microsoft-Windows-Client-LanguagePack-Package

В следующей статье мы поговорим как с помощью DISM и Powershell управлять так называемыми Modern-приложениями AppX.

Источник

How to add or remove Windows 10 features or components

Windows 10 comes with a predefined set of features or components. You can customize Windows 10 by removing the features that you are not using and by adding those you need but are not installed by default. Moreover, if you remove unwanted components, you can save quite a bit of space on your hard disk. This tutorial teaches you how to add and remove Windows features in Windows 10. The process is pretty straightforward, so let’s get started:

How to open Windows Features in Windows 10

In Windows 10, click or tap the search field in your taskbar, and enter “windows features. Click or tap the “Turn Windows features on or off” option from the list.

Alternatively, to access Windows Features, first, open the Control Panel. Click or tap the “Uninstall a program” link, found in the Programs section of the Control Panel.

The “Programs and Features” window is mostly used to uninstall unwanted apps and programs. Click or tap the “Turn Windows features on or off” option in the column on the left.

The Windows Features window opens, displaying a list of all the available features that you can add or remove according to your preferences.

The checked entries are already installed on your computer or device, while those unchecked are not installed.

How to remove Windows 10 features or components

The Windows Features window lists all the features or components available for Windows 10. To view more information about a feature, hover on top of it with your mouse or tap on it, and a brief description appears.

If you want even more details about each component, read: What are those Windows features that you can add or remove?

Once you decide which components have to be removed, uncheck the box next to them to uninstall unnecessary Windows features. When you uncheck certain features, like “Internet Explorer 11, Windows 10 warns you that turning them off might affect other Windows features, programs or default settings, and it asks for further confirmation.

You might think that “Go online to learn more” link might provide more specific info about the component you are disabling, but clicking or tapping on it takes you to a generic Windows help page offering more information about Windows 10.

Click or tap Yes in the warning window asking you if you want to continue, and then confirm your change(s) once more by clicking or tapping OK in the Windows Features window.

A loading screen keeps you updated on the progress, letting you know your system is “Searching for required files” first.

Читайте также:  Restart postgresql windows 10

You then have to wait while the changes you requested are being applied.

After removing certain features, like “Internet Explorer 11, Windows 10 may inform you that it needs to restart your computer or device to apply the requested changes. Press Restart now, and wait for the reboot to be performed, taking into consideration that this restart takes longer than usual, because Windows 10 needs to spend additional time to configure itself according to your instructions.

Other components, like Media Features, may be removed without a system restart. If that is the case for the features you chose to get rid of, you are informed that “Windows completed the requested changes.” Click or tap Close, and you are done.

TIP: If you are interested in purging your Windows 10 computer or device of more unnecessary software, you can also read: How much bloatware does Windows 10 have?

How to add Windows 10 features or components

To add features to Windows 10, check their boxes in the Windows Features window, and then click or tap OK.

You need to wait while Windows 10 is searching for the files required to install the selected feature.

For certain features, Windows 10 might need to download some files from Windows Update in order to successfully add the requested components. Press the “Let Windows Update download the files for you” link to continue the process.

Be patient while Windows 10 downloads the required files.

Regardless of whether additional files had to be downloaded or not, Windows 10 displays its progress when applying the requested changes.

For certain components, like “Virtual Machine Platform, rebooting your Windows 10 computer or device is required to finish installing your changes. Click or tap “Restart now” and remember that the reboot may take some extra time to configure the added components.

Other features, like “Windows Projected File System, do not require a restart. Once your changes are completed, press Close to finish the process.

Windows 10 now includes the feature(s) that you have selected for installation.

Did you save disk space by removing Windows 10 features?

Out of curiosity, and because we were not using them, we removed all Windows 10 components installed by default on our device. We kept an eye out on the “C:” drive, where Windows 10 is installed, and noticed it became 800MB lighter. In conclusion, removing unwanted features also saves space on your hard drive. Did you remove any components from your system? How much free disk space did you gain? Comment below and let’s discuss.

Источник

Part 4: Add Windows 10 user activities and notifications

This is the fourth part of a tutorial that demonstrates how to modernize a sample WPF desktop app named Contoso Expenses. For an overview of the tutorial, prerequisites, and instructions for downloading the sample app, see Tutorial: Modernize a WPF app. This article assumes you have already completed part 3.

In the previous parts of this tutorial you added UWP XAML controls to the app using XAML Islands. As a by product of this, you also enabled the app to call any WinRT API. This opens up the opportunity for the app to use many other features offered by Windows 10, not just UWP XAML controls.

In the fictional scenario of this tutorial, the Contoso development team has decided to add two new features to the app: activities and notifications. This part of the tutorial shows how to implement these features.

Add a user activity

In Windows 10, apps can track activities performed by the user such as opening a file or displaying a specific page. These activities are then made available through Timeline, a feature introduced in Windows 10 version 1803, which allows the user to quickly go back to the past and resume an activity they started previously.

User activities are tracked using Microsoft Graph. However, when you’re building a Windows 10 app, you don’t need to interact directly with the REST endpoints provided by Microsoft Graph. Instead, you can use a convenient set of WinRT APIs. We’re going to use these WinRT APIs in the Contoso Expenses app to track every time the user opens an expense within the app, and use Adaptive Cards to enable users to create the activity.

Introduction to Adaptive Cards

This section provides a brief overview of Adaptive Cards. If you don’t need this information, you can skip this and go right to the add an Adaptive Card instructions.

Adaptive Cards enable developers to exchange card content in a common and consistent way. An Adaptive Card is described by a JSON payload that defines its content, which can include text, images, actions, and more.

An Adaptive Card defines just the content and not the visual appearance of the content. The platform where the Adaptive Card is received can render the content using the most appropriate styling. The way Adaptive Cards are designed is through a renderer, which is able to take the JSON payload and to convert it into native UI. For example, the UI could be XAML for a WPF or UWP app, AXML for an Android app, or HTML for a website or a bot chat.

Here is an example of a simple Adaptive Card payload.

The image below shows how this JSON is rendered in different ways by ta Teams channel, Cortana and a Windows notification.

Adaptive cards play an important role in Timeline because it’s the way Windows renders activities. Each thumbnail displayed inside Timeline is actually an Adaptive Card. As such, when you’re going to create a user activity inside your app, you will be asked to provide an Adaptive Card to render it.

A great way to brainstorm the design of an Adaptive Card is using the online designer. You will have the chance to design the card with building blocks (images, texts, columns, etc) and get the corresponding JSON. After you have an idea of the final design, you can use a library called Adaptive Cards to make it easier to build your Adaptive Card using C# classes instead of plain JSON, which might be hard to debug and build.

Add an Adaptive Card

Right click on the ContosoExpenses.Core project in Solution Explorer and choose Manage NuGet packages.

In the NuGet Package Manager window, click Browse. Search for the Newtonsoft.Json package and install the latest available version. This is a popular JSON manipulation library that you will use to help mainipulate the JSON strings required by Adaptive Cards.

In the NuGet Package Manager window, click Browse. Search for the AdaptiveCards package and install the latest available version.

In the TimelineService.cs file, add the following statements to the top of the file.

Add the following method to the TimelineService class.

About the code

This method receives an Expense object with all the information about the expense to render and it builds a new AdaptiveCard object. The method adds the following to the card:

Читайте также:  Subject перевод в windows

The last 3 elements are split into two different columns, so that the Contoso logo and the details about the expense can be placed side by side. After the object is built, the method returns the corresponding JSON string with the help of the ToJson method.

Define the user activity

Now that you have defined the Adaptive Card, you can create a user activity based on it.

Add the following statements to the top of TimelineService.cs file:

Add the following field declarations to the TimelineService class.

Add the following method to the TimelineService class.

Save the changes to TimelineService.cs.

About the code

The AddToTimeline method first gets a UserActivityChannel object that is required to store user activities. Then it creates a new user activity using the GetOrCreateUserActivityAsync method, which requires a unique identifier. This way, if an activity already exists, the app can update it; otherwise it will create a new one. The identifier to pass depends by the kind of application you’re building:

In this scenario, the app will track each opened expense as a different user activity, so the code creates each identifier by using the keyword Expense- followed by the unique expense ID.

After the method creates a UserActivity object, it populates the object with the following info:

This is where the Adaptive Card you defined earlier plays a role. The app passes the Adaptive Card you designed earlier as content to the method. However, Windows 10 uses a different object to represent a card compared to the one used by the AdaptiveCards NuGet package. Therefore, the method recreates the card by using the CreateAdaptiveCardFromJson method exposed by the AdaptiveCardBuilder class. After the method creates the user activity, it saves the activity and creates a new session.

When a user clicks on an activity in Timeline, the contosoexpenses:// protocol will be activated and the URL will include the information the app needs to retrieve the selected expense. As an optional task, you could implement the protocol activation so that the application reacts properly when the user uses Timeline.

Integrate the application with Timeline

Now that you have created a class that interacts with Timeline, we can start using it to enhance the application’s experience. The best place to use the AddToTimeline method exposed by the TimelineService class is when the user opens the detail page of an expense.

In the ContosoExpenses.Core project, expand the ViewModels folder and open the ExpenseDetailViewModel.cs file. This is the ViewModel that supports the expense detail’s window.

Locate the public constructor of the ExpenseDetailViewModel class and add the following code at the end of the constructor. Whenever the expense window is opened, the method calls the AddToTimeline method and passes the current expense. The TimelineService class uses this info to create a user activity using the expense information.

When you are done, the constructor should look like this.

Press F5 to build and run the app in the debugger. Choose an employee from the list and then choose an expense. In the detail page, note the description of the expense, the date and the amount.

Press Start + TAB to open Timeline.

Scroll down the list of currently opened applications until you see the section titled Earlier today. This section shows some of your most recent user activities. Click the See all activities link next to the Earlier today heading.

Confirm that you see a new card with the information about the expense you have just selected in the application.

If you now open other expenses, you will see new cards being added as user activities. Remember that the code uses a different identifier for each activity, so it creates a card for each expense you open in the app.

Add a notification

The second feature the Contoso development team wants to add is a notification that is shown to the user whenever a new expense is saved to the database. To do this, you can leverage the built-in notifications system in Windows 10, which is exposed to developers via WinRT APIs. This notification system has many advantages:

To add a notification to the app:

In the NotificationService.cs file, add the following statements to the top of the file.

Add the following method to the NotificationService class.

Toast notifications are represented by an XML payload, which can include text, images, actions, and more. You can find all the supported elements here. This code uses a very simple schema with two lines of text: the title and the body. After the code defines the XML payload and loads it in a XmlDocument object, it wraps the XML in a ToastNotification object and shows it by using a the ToastNotificationManager class.

In the ContosoExpenses.Core project, expand the ViewModels folder and open the AddNewExpenseViewModel.cs file.

Locate the SaveExpenseCommand method, which is triggered when the user presses on the button to save a new expense. Add the following code to this method, just after the call to the SaveExpense method.

When you are done, the SaveExpenseCommand method should look like this.

Press F5 to build and run the app in the debugger. Choose an employee from the list and then click the Add new expense button. Complete all fields in the form and press Save.

You will receive the following exception.

This exception is caused by the fact that the Contoso Expenses app doesn’t yet have package identity. Some WinRT APIs, including the notifications API, require package identity before they can be used in an app. UWP apps receive package identity by default because they can only be distributed via MSIX packages. Other types of Windows apps, including WPF apps, can also be deployed via MSIX packages to obtain package identity. The next part of this tutorial will explore how to do this.

Next steps

At this point in the tutorial, you have successfully added a user activity to the app that integrates with Windows Timeline, and you have also added a notification to the app that is triggered when users create a new expense. However, the notification doesn’t yet work because the app requires package identity to use the notifications API. To learn how to build an MSIX package for the app to obtain package identity and gain other deployment benefits, see Part 5: Package and deploy with MSIX.

Источник

Install-Windows Feature

Installs one or more roles, role services, or features on either the local or a specified remote server that is running Windows Server 2012 R2. This cmdlet is equivalent to and replaces Add-WindowsFeature, the cmdlet that was used to install roles, role services, and features in Windows Server 2008 R2.

Syntax

Description

The Install-WindowsFeature cmdlet installs the specified features on a computer that is running Windows Server 2012 R2, or on an offline virtual hard disk (VHD) on which Windows Server 2012 R2 is installed. This cmdlet works similarly to the installation of roles and features in Server Manager, with an important exception: the cmdlet does not install management tools for the features by default. To install management tools such as snap-ins on a target server, you must add the IncludeManagementTools parameter to your command.

Читайте также:  Trustedinstaller windows 10 разрешение на удаление

This cmdlet requires elevation; you must be running a Windows PowerShell session as an administrator to use this cmdlet.

Examples

EXAMPLE 1

This example shows what is installed with Web Server (IIS), including all role services, on a computer named Server1. By adding the WhatIf parameter, you can view the results of the installation command without running it.

EXAMPLE 2

This example installs Web Server (IIS), including all role services and applicable management tools, on a computer named Server1, by using the credentials of a user account named contoso.com\johnj99.

EXAMPLE 3

This example installs all roles, role services and features that are specified in a configuration file named ADCSConfigFile.xml. The configuration file was created by clicking Export configuration settings on the Confirm installation selections page of the arfw in Server Manager.

EXAMPLE 4

EXAMPLE 5

EXAMPLE 6

This example installs Web Server (IIS) on the local computer, specifying that the source of feature files for the installation is a folder, winsxs, on a computer named Server2. The computer account of the local computer must have Read permissions on the specified share.

Parameters

Installs one or more available features on a specified remote computer. This parameter accepts only one computer name. If this parameter is not added, or no computer name is specified, the default target is the local computer.

Valid values for the parameter include a NetBIOS name, an IP address, or a fully qualified domain name of a remote computer that is running Windows Server

To use an IP address of a remote computer as the value of this parameter, your command must include the Credential parameter. The computer must either be configured for HTTPS transport, or the IP address of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For information about adding a computer name to the WinRM TrustedHosts list, see «How to Add a Computer to the Trusted Host List» in about_Remote_Troubleshootinghttp://go.microsoft.com/fwlink/p/?LinkID=135188.

Type: String
Aliases: Cn
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

If this parameter is specified, then the Name parameter cannot be used.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Aliases: cf
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Specifies a user account that has access rights to perform this action. If the parameter is not added, or no value is specified, the default value of this parameter is the current user. Enter a user name in one of the following formats. Quotation marks are optional.

A Credential object returned by the Get-Credentialhttp://go.microsoft.com/fwlink/p/?LinkID=113311 cmdlet.

If a user name is entered, then a prompt for a password is displayed.

Type: PSCredential
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies that all subordinate role services, and all subfeatures of parent roles, role services, or features specified by the Name parameter should be installed.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies that all applicable management tools of the roles, role services, or features specified by the Name parameter should be installed. Note: Although management tools are installed by default when you are installing features by using the arfw, management tools are not installed by default when you install features by using the Install-WindowsFeature cmdlet; this parameter must be added to install management tools.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies a name and path to a log file. Add this parameter if the results of your command must be stored in a log.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies a list of features to install. This parameter does not support wildcard characters. If this parameter is specified, then the ConfigurationFilePath parameter cannot be used.

Type: Feature [ ]
Position:
Default value: None
Accept pipeline input: True
Accept wildcard characters: False

Specifies that the target computer is restarted automatically, if a restart is required by the installation process for the specified roles or features. This parameter cannot be used with the Vhd parameter.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The path specified in this parameter is only used if the command cannot find feature files in the local side-by-side store of the specified target computer or VHD. The command searches for feature files in the following order:

On the target computer or offline VHD.

Path specified as the value of this parameter. If you add a UNC path, verify that the computer account of the target server has Read permissions on the share. The computer account should be in one of the following formats: DOMAIN\SERVERNAME$ or SERVER$

Repository path specified by the Group Policy Object (GPO), Specify settings for optional component installation and component repair, located in Computer Configuration/Administrative Templates/System in Local Group Policy Editor. This Group Policy setting controls the following Windows Registry setting: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing\LocalSourcePath.

This parameter is optional.

Type: String [ ]
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies the path to an offline VHD. The path can either point to a VHD file, or to a location on which the VHD is already mounted by using Deployment Image Servicing and Management (DISM) tools.

The VHD can be on a local disk on the target computer, or on a network shared folder. If the VHD is in a network shared folder, then the value of this parameter is a UNC path to the VHD. In this case, the computer account of the computer that you are using to mount the VHD must have read and write permissions (Read/Write permissions in the File Sharing dialog box, or Full Control on the Security tab of the folder Properties dialog box) on the shared folder, or the VHD will not be accessible. Local loopback UNC paths are not supported. Use either of the following formats for the computer account: DOMAIN\SERVERNAME$ or SERVERNAME$.

Add the ComputerName parameter to specify the target computer you want to use to mount the VHD. If the ComputerName parameter is not specified, then the local computer is used. The computer that you are using to mount the VHD must be running Windows Server 2012 R2. Any local path, such as D:\myFolder, that is specified by using this parameter is always relative to the target computer.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Источник

Поделиться с друзьями
Советы экспертов и специалистов
Adblock
detector