正确认识 Source 参数

正确认识 Source 参数

Enable-WindowsOptionalFeature

Enables a feature in a Windows image.

语法

    Enable-WindowsOptionalFeature [-All] [-LimitAccess] [-LogLevel <LogLevel>] [-LogPath <String>] [-NoRestart] [-PackageName <String>] [-ScratchDirectory <String>] [-Source <String[]>] [-SystemDrive <String>] [-WindowsDirectory <String>] -FeatureName <String[]> -Online [<CommonParameters>]

    Enable-WindowsOptionalFeature [-All] [-LimitAccess] [-LogLevel <LogLevel>] [-LogPath <String>] [-NoRestart] [-PackageName <String>] [-ScratchDirectory <String>] [-Source <String[]>] [-SystemDrive <String>] [-WindowsDirectory <String>] -FeatureName <String[]> -Path <String> [<CommonParameters>]

-Source <String[]>
Specifies the location of the files that are required to restore a feature that has been removed from the image. You can specify the Windows directory of a mounted image or a running Windows installation that is shared on the network.

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 feature names with a comma.

一直错误地认为 Source 只支持一个目录,还纳闷一个目录为啥要用数组呢?
原来是支持多个目录的;
如果在多个目录下有同名的文件,只使用第一个目录中的,其余的忽略。
而不是只认第一个目录,其余的忽略。

唉!

多个目录用逗号分隔。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值