I am trying to write a query to see if a workspace with specific name already exists in repository or not. Following is the query I am using after logging in a previous command:
$wsQueryResult = &scm query -r https://myrationaluri -w "name='myworkspace"
I get output similar to following:
At C:\scripts\vso-rtc\get-code-fromRTC.ps1:27 char:19
+ $wsQueryResult = &scm query -r myurl -w "name='my ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Problem running 'query'::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
No repository workspace matches the query "name='myworkspace'".
The query is inside a powershell script. I understand the last part of the response "No repository workspace matches the query..." However, why do I get Problem running query::String. The value of $wsQueryResult is null after this execution. I was hoping that there will be an exit code or something.
Is the problem in my query syntax or is this normal. If it is normal, do I need to examine the output for line "no repository workspace"
Thank you for your help.