Forum Discussion
stop expanding parentheses in a variable
Hello
We have created a script using PowerShell and Box CLI to create groups in Box as a user request them. We have had success with the script until recently.
We had a user request that failed
$ClientName="Test-Group(Name)"
$BoxClientOwnerName="$($ClientName)_Owner"
$BoxLOWGRPRaw="$( Box groups:create --json $BoxClientOwnerName )"
The script returns the error
_Owner was unexpected at this time.
If we enter the group name not as a variable, it will work
$BoxLOWGRPRaw="$( Box groups:create --json "Test-Group(Name)" )"
We believe that it is trying to expand the information in the ()
We have tried several different ways to create the group variable name, but have not had success yet.
We have tried to use escape characters to stop the processing of the (), but no success.
Could you please help us resolve this issue?
Thank you