Presumably, calling powershell.exe is not needed at all. Replace it with the & operator, i.e. Call the script in the same session and avoid parameter conversions and related problems. Problems are solvable, but best avoided first. That is do
& $currentDirectory/Deploy.ps1 -reload:$true -env:$env -provisionsites:$provisionsites
As for the problems. $provisionsites converted to a string ( True or False , not $true or $false ) before being transferred to an external application. So the actual arguments to the result look like -provisionsites:True . Then, in a new powershell session, it passes such an argument to script Deploy.ps1 . It fails because True or False strings are not expected, a Boolean value is expected.
A possible workaround would be to add the $ escape code
powershell $currentDirectory/Deploy.ps1 ... -provisionsites:`$$provisionsites
But consider removing the powershell call and its problems.
source share