PoweShell Issue for git log

Hi,
My below code is not working in octopus powershell step. Same is working on tentacle powershell windows. $StartingHash and $EndingHash are variable passed through teamcity. Same are defined in octopus.

if($EndingHash) {
Write-Host “EndingHash is not null”
$LastHash = $EndingHash
} else {
Write-Host “EndingHash is EMPTY or NULL”
$LastHash = “HEAD”;
}

git log --pretty=format:–name-only “$StartingHash…$LastHash” | sort | uniq | grep -i ‘".sql"’ > C:\Ashish\data\sqlRB-$BuildNumber.txt
git log --pretty=format:–name-only “$StartingHash…$EndingHash” | sort | uniq | grep -i ‘".sql"’ > C:\Ashish\data\sqlRB-.txt
git log --pretty=format:–name-only f116bcce5cc0701cb0b5a673bc4ce9f723050f04…2870d215c7201e7cf65c71d4d0e732078b3bda31 | sort | uniq | grep -i ‘".sql"’ > C:\Ashish\data\sqlRB.txt

any of three commands are not working. Output text file is empty in any of three cases.

Regards,
Ashish

I have resolved issue. A white Space required after format:- . Correct command is

git log --pretty=format: --name-only “$StartingHash…$LastHash” | sort | uniq | grep -i ‘".sql"’ > C:\Ashish\data\sqlRB-$BuildNumber.txt