- Add-Windows Capability
- Syntax
- Description
- Examples
- Example 1: Add a Windows capability package to the running OS via the Windows Update client
- Example 2: Add a Windows capability package to the running OS using a locally stored package file
- Example 3: Add a Windows capability package to an image
- Parameters
- Outputs
- Notes
- Страна Админа
- Популярно об информационных системах и технологиях
- admin@adminland.ru
- Вы здесь
- Поддержите adminland
- Install-WindowsFeature Ошибка 0x800f0906
- Форумы:
- параметр source
- Для компонента Net-Framework
- Net Framework
- В инсталляции Server 2012 нет
- NET Framework 3.5 SxS
- Install-Windows Feature
- Syntax
- Description
- Examples
- EXAMPLE 1
- EXAMPLE 2
- EXAMPLE 3
- EXAMPLE 4
- EXAMPLE 5
- EXAMPLE 6
- Parameters
Add-Windows Capability
Installs a Windows capability package on the specified operating system image.
Syntax
Description
The Add-WindowsCapability cmdlet acquires a Windows capability package from a priority-ordered list of source locations, and then installs the package on the specified operating system image.
Examples
Example 1: Add a Windows capability package to the running OS via the Windows Update client
This command adds a Windows capability package to the running operating system. Because no source is specified, the Windows Update client will download the necessary package. It requires either an active Internet connection or an active network connection to the local Windows Server Update Services (WSUS) server.
Example 2: Add a Windows capability package to the running OS using a locally stored package file
This command adds a Windows capability package specified by the Name parameter, to the running operating system. The Source parameter specifies the location of required files. For instance, if the running OS is a copy of Windows 10 version 1809, the Msix-PackagingTool-Driver-Package
.cab file must be present at E:\ .
If the package specified by the Name parameter is already installed, this command does not return an error message, regardless of whether the required files are present at E:\ .
Example 3: Add a Windows capability package to an image
This command adds a Windows capability package specified by the Name parameter, to the operating system image at the path C:\mount\Windows. The Source parameter specifies the location of required files. For instance, if the mount point contains a copy of Windows 10 version 1809, the Msix-PackagingTool-Driver-Package
.cab file must present at E:\ .
Parameters
Indicates that this cmdlet does not query Windows Update for source packages when servicing a live OS. Only applies when the -Online switch is specified.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the maximum output level shown in the logs.
Type: | LogLevel |
Aliases: | LL |
Accepted values: | Errors, Warnings, WarningsInfo |
Position: | Named |
Default value: | WarningsInfo |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the full path and file name to log to. If not set, the default is «$env:WINDIR\Logs\Dism\dism.log» . In Windows PE, the default directory is the RAMDISK scratch space which can be as low as 32 MB. The log file will automatically be archived. The archived log file will be saved with .bak appended to the file name and a new log file will be generated. Each time the log file is archived the .bak file will be overwritten. When using a network share that is not joined to a domain, use the net use command together with domain credentials to set access permissions before you set the log path for the DISM log.
Type: | String |
Aliases: | LP |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the identity of the capability to add to an operating system image.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Indicates that the cmdlet operates on a running operating system on the local host.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the full path to the root directory of the offline Windows image that you will service. If the directory named Windows is not a subdirectory of the root directory, WindowsDirectory must be specified.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies a temporary directory that will be used when extracting files for use during servicing. The directory must exist locally. If not specified, the «$env:Temp» directory will be used, with a subdirectory name of a randomly generated hexadecimal value for each run of DISM. Items in the scratch directory are deleted after each operation. You should not use a network share location as a scratch directory to expand a package (.cab or .msu file) for installation. The directory used for extracting files for temporary usage during servicing should be a local directory.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the location of the files that are required to add a Windows capability package to an image. If you specify multiple Source arguments, the files are gathered from the first location where they are found and the rest of the locations are ignored. Separate source locations with a comma.
If you do not specify a Source, the default location set by Group Policy is used. If that fails, Windows Update is also used for online images, unless LimitAccess is specified. When all fail, the cmdlet fails silently; no exceptions are thrown.
Source can only be used when servicing images that are running at least WindowsВ® 8 or Windows ServerВ® 2012.
Type: | String [ ] |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the path to the location of the BootMgr files. This is necessary only when the BootMgr files are located on a partition other than the one that you are running the command from. Use -SystemDrive to service an installed Windows image from a Windows PE environment.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the path to the Windows directory relative to the image path. This cannot be the full path to the Windows directory; it should be a relative path. If not specified, the default is the Windows directory in the root of the offline image directory.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Outputs
Microsoft.Dism.Commands.ImageObject
Notes
As of Windows 10 version 1709, you cannot use Windows Server Update Services (WSUS) to host Features on Demand (FOD) and language packs for Windows 10 clients. Instead, you can enforce a Group Policy setting that tells the clients to download them directly from Windows Update. You can also host FOD and language packs on a network share, but starting with Windows 10 version 1809, FOD and language packs can only be installed from Windows Update. For more information, see How to make Features on Demand and language packs available when you’re using WSUS/Configuration Manager.
Страна Админа
Популярно об информационных системах и технологиях
admin@adminland.ru
Вы здесь
Поддержите adminland
За 2020 год из пары десятков тысяч посетителей, набралось всего пару десятков перечислений от 50 до 300 рублей.
Пустяк в денежном выражении, но большая ценность для автора. Посмотрим что год грядущий нам готовит ))
Сумма абсолютно не важна — главное участие.
Install-WindowsFeature Ошибка 0x800f0906
В server 2012 совершенно свободно можно превращать core в full и наоборот. Элементы графического интерфейса, теперь, можно устанавливать и удалять как и другие компоненты (feature).
Full отличается от core двумя компонентами:
Server-Gui-Mgmt-Infra — минимальный графический интерфейс с Server Manager и MMC
Server-Gui-Shell — графическая оболочка
Компоненты в core установке можно добавить powershell командой Install-WindowsFeature, она же Add-WindowsFeature.
Однако Install-WindowsFeature Server-Gui-Mgmt-Infra долго думает и завершается с ошибкой:
Install-WindowsFeature : The request to add or remove features on thespecified server failed.
Installation of one or more roles, role services, or features failed.
The source files could not be downloaded.
Use the «source» option to specify the location of the files that are required to restore the feature. For more information on specifying a source location,
see http://go.microsoft.com/fwlink/?LinkId=243077. Error: 0x800f0906
Форумы:
параметр source
Опубликовано 17 августа, 2013 — 12:56 пользователем manager
укажите параметр -source с путем к install.wim например:
Install-WindowsFeature Server-Gui-Mgmt-Infra -Source wim:f:\sources\install.wim:2
2 это индекс инсталляционного пакета внутри install.wim, посмотреть содержимое wim можно командой:
dism /get-wiminfo /wimfile:f:\sources\install.wim
Для компонента Net-Framework
Опубликовано 17 августа, 2013 — 12:59 пользователем manager
Для компонента Net-Framework-Core фокус не прошел.
Понадобился доступ к Windows Update. Установить с локального источника не получилось.
Net Framework
Опубликовано 28 апреля, 2014 — 12:31 пользователем Эдуард (не проверено)
А для установки Framework в качестве источника нужно указать папку Sources\SxS. Команда будет выглядеть так:
Install-WindowsFeature NET-Framework-Features -Source D:\Sources\sxs
Всё утро провозился с этим Server-Gui-Mgmt-Infra, а дело оказывается в wim было. У вас в блоге только и нашёл. Зачем они так запутанно сделали с источниками, непонятно. Microsoft такой Microsoft
В инсталляции Server 2012 нет
Опубликовано 11 июня, 2014 — 17:51 пользователем Anonymous (не проверено)
В инсталляции Server 2012 нет NET Framework 3.5 Нужно устанавливать через Windows Update.
NET Framework 3.5 SxS
Опубликовано 30 июля, 2015 — 10:25 пользователем manager
NET Framework 3.5 присутствует на установочном диске и его можно установить указав каталог SxS в параметре -source.
Большое количество ошибок связано с использованием не родного установочного диска. Например, ставят сервер EN, а потом пытаются доустановить NET-Framework-Core с русского дистрибутива.
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.
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
This example installs Active Directory Certificate Services (AD CS) as specified in a configuration file named ADCSConfigFile.xml. AD CS is installed on a list of computers that is contained in the variable $servers. The configuration file was created by clicking Export configuration settings on the Confirm installation selections page of the arfw in Server Manager. On the first line, the value of the $servers variable is set; on the second line, the installation instructions in the ADCSConfigFile.xml configuration file are applied to each of the servers that has been named in $servers.
EXAMPLE 5
This example retrieves a list of all Windows features beginning with the characters Web, and then pipes the resulting list to Install-WindowsFeature . The result of this cmdlet is all features that start with Web are installed on the local computer.
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 |
Provides a single path to a configuration file which specifies roles and features to be installed, and any configuration parameters needed. The path can be specified by using a local relative path (such as D:\myfolder) or by using built-in environment variables prefixed with the $env tag (such as $env:systemdrive\filename). A configuration file can be generated by running the arfw in Server Manager.
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: | 0 |
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 |
Specifies the path to feature files, if the files are not available in the local feature store of the target computer or VHD. Valid values for this parameter are either a network path or the path to a Windows image file (WIM). If you are installing roles or features on an offline VHD, you must use a mounted WIM. It is not necessary to mount the WIM file for installing on a running physical computer, because a WIM is mounted internally for deployments to a physical computer. Specify the path by using a local relative path, or by using built-in environment variables that are prefixed with the $env tag as shown in the following examples.
If this parameter is used in combination with the -ComputerName parameter, the source path must be accessible by the target computer (e.g. local devices/drives/paths on the client system will cause the installation to fail).
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.