Closed uka-support closed 2 years ago
now if i only call Get-bConnectVariableDefinition -id $id
i get this:
![string]::IsNullOrEmpty
didn't help me
Ah, I see. If I use -Scope that is ignored anyway because I pass "Device"! And category and name may only be used when scope is used too.
Well, the "Device" get's assigned integer value 0 in that enum, so there's no easy way to check whether the parameter has been passed to the function or not.
Maybe make the comparison explicit: if ($Scope -ne $null)
?
$Scope = [bConnectVariableScope]::Device
if ($Scope) { echo "yo" }
if ($Scope -ne $null) { echo "yo" }
Other solution: assign explicit numbers to the bConnectVariableScope, starting with 1, not 0.
Prior to placing the issue, please check following: (fill out each checkbox with an
X
once done)Describe the bug When calling Get-bConnectVariableDefinition -Scope Device -Category "somecategory", the request fails.
To Reproduce Steps to reproduce the behavior:
Expected behavior Request should work :-)
Additional context Discussion in forum
I'm not sure what's going on here.
$result = Invoke-RestMethod -uri https://bmsserver/bConnect/v1.1/VariableDefinitions -Body @{Scope="Device";Category="somecategory"} -Credential $creds -Method Get -ContentType "application/json; charset=utf-8"
- This should be the effective command issued by Invoke-bConnectGetMy conclusion: something obscure within the bConnect module? Or yet another Powershell strange behaviour?