PowerShell cmdlet中的Copy-Item用于将项目从一个位置复制到同一命名空间中的另一位置。在这里,命名空间的含义是,您可以将项目从文件复制到其他文件夹,但不能将文件复制到注册表或证书存储。
该cmdlet不会从源位置删除或剪切项目,而是将项目复制到具有相同名称或不同名称的目标文件夹中。
在PowerShell中带有参数的复制项语法如下。
Copy-Item
[-Path] <String[]>
[-LiteralPath] <String[]>
[[-Destination] <String>]
[-Container]
[-Force]
[-Filter <String>]
[-Include <String[]>]
[-Exclude <String[]>]
[-Recurse]
[-PassThru]
[-Credential <PSCredential>]
[-WhatIf]
[-Confirm]
[-FromSession <PSSession>]
[-ToSession <PSSession>]
[<CommonParameters>]
Copy-Item cmdlet别名是copy和cp。
正文完