WinRAR이 실행되고 일종의 작업을 수행하는 것처럼 보이지만 찾을 수없는 것처럼 보이는 특정 위치에서 지정된 디렉터리를 압축해야하는 Powershell 스크립트가 있습니다. 여기서 zip 파일은 파일 시스템에서 끝납니다.Powershell 명령 줄 Winrar가 예상 위치에 파일을 만들지 않습니다.
아이디어는 내가 디렉토리를 압축 한 다음 파일 시스템에서 압축 해제 된 디렉토리를 삭제한다는 것입니다.
$ 파일 경로 변수는 디렉토리의 위치를 압축 (기본 위치 포함)로되면, $ rarExePath는 WinRAR.exe
# zips up any files in the directory
function ZipDirectory($filePath, $rarExePath)
{
"Zipping directory $filePath"
#$zipFilePath = (Split-Path $filePath -Parent)
$archiveName = (Split-Path $filePath -Leaf) + ".rar"
"Zipping directory $dirPath to file $archiveName $zipFilePath"
Start-Process $rarExePath -ArgumentList "a -r $archiveName $filePath"
#Remove-Item -Recurse $filePath
"Completed..."
}
의 경로에 분명히 잘못이 있나요이다 내 명령?
을 ...에서 –