I check out a working copy of a project using Checkout-WorkingCopy and later delete the directory using Cleanup-WorkingCopy (the code for these functions is at the end of this post).
Problems I am facing:
- Instead of echoing
"Checking out from svn://somePath1 to C:/somePath2"
it echoes"Checking out from svn://somePath1 C:/somePath2 to"
In Cleanup-WorkingCopy, it throws the following error while trying to execute
Pushd
,<Push-Location : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'LiteralPath'. Specified method is not supported. + Pushd <<<< $directory + CategoryInfo : InvalidArgument: (:) [Push-Location], ParameterBindingException + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.PushLocationCommand>
Finally, I get the error
"The syntax of the command is incorrect"
while executingRmdir
.
The functions I use are given below. I have checked the arguments sent to the functions and they are correct.
#Checks out a copy from svnPath into appFilePath
Function Checkout-WorkingCopy($svnPath, $appFilePath) {
Echo "Checking out from $svnPath to $appFilePath"
svn checkout $svnPath $appFilePath --quiet
Echo "Checkout Done"
}
#Deletes the working copy previously checked out
Function Cleanup-WorkingCopy($directory, $appFilePath) {
Pushd $directory
Cmd /C "Rmdir /S /Q $appFilePath"
}