반응형
'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
반응형
'programing' 카테고리의 다른 글
컨텍스트에 관계없이 SimpleXML 개체를 문자열로 강제 적용 (0) | 2020.10.23 |
---|---|
AsyncCallback이란 무엇입니까? (0) | 2020.10.23 |
Bootstrap 3-인쇄 레이아웃 및 각 그리드 열 뒤의 끊김 (0) | 2020.10.23 |
eslint-config-airbnb가있는 확장자가 '.js'인 파일에서는 JSX를 사용할 수 없습니다. (0) | 2020.10.23 |
Spring MVC에서 포스트 데이터를 명시 적으로 얻는 방법은 무엇입니까? (0) | 2020.10.23 |