반응형
'PowerShell' Copy-Item에서 파일을 무조건 복사하도록 지시하려면 어떻게 해야 합니까?
다음 PowerShell 스크립트는 리소스가 없으면 작동합니다.
Copy-Item $src_dir $dst_dir$agent_folder -recurse
그러나 리소스가 있으면 다음과 같이 표시됩니다.
+ Copy-Item <<<< $src_dir $dst_dir$agent_folder -recurse
+ CategoryInfo : ResourceExists: (C:\Users\Pac\Desktop\Agents\Agent0\lib:S
tring) [Copy-Item], IOException
+ FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.CopyItemComm
and
파일이 무조건 복사되도록 하려면 명령에 무엇을 추가해야 합니까?
이 있습니다.-force
매개 변수입니다.
설명서에서 확인)를 참조하십시오.help copy-item -full
):
-force <SwitchParameter>
Allows cmdlet to override restrictions such as renaming existing files as long as security is not compromised.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
언급URL : https://stackoverflow.com/questions/1787836/how-to-tell-powershell-copy-item-to-unconditionally-copy-files 입니다.
반응형
'programing' 카테고리의 다른 글
Excel 공식에 변수 같은 것이 있나요? (0) | 2023.04.25 |
---|---|
ASP.NET: 세션입니다.요청 간에 SessionID가 변경됩니다. (0) | 2023.04.25 |
여러 줄 편집은 어떻게 하나요? (0) | 2023.04.25 |
@viewchild를 사용하여 여러 뷰 하위 항목에 액세스합니다. (0) | 2023.04.25 |
Eclipse에서 프로젝트를 그룹화할 수 있습니까? (0) | 2023.04.25 |