friedrichweinmann / bconnect Goto Github PK
View Code? Open in Web Editor NEWPowerShell Module to interact with the Baramundi bConnect Rest API
License: MIT License
PowerShell Module to interact with the Baramundi bConnect Rest API
License: MIT License
Edit-bConnectApplication was never working correctly. The original function just passed the whole Application Object to the Rest API. This generates an error, because the application controller, just like the endpoint controller only acceppt an object with the changed properties.
I have just finished migrating the entire code-base into this new project.
One of the things I encountered that were ... questionable but wasn't able to verify one way or the other was the validation on Guids.
Virtually all instances validate for strings that contain a valid guid, not for strings that are a valid guid!
The common pattern used was this:
'\b[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}\b'
This will match a guid correctly:
(New-Guid) -match '\b[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}\b'
but also something like this:
$text = "This is my story of {0} and his seven friends" -f (New-Guid)
$text -match '\b[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}\b'
with $text
containing something like this:
This is my story of 2a3642e1-cc34-4554-8591-6752664f8af7 and his seven friends
If this is not intended and pure Guids are required, I recommend changing validation to test for end of text, not end of word:
'^[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}$'
This will still validate any guid correctly:
(New-Guid) -match '^[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}$'
Hi Developers,
the ConsistencyChecks field in the baramundi application object consists of a text object which has/allows CR and LF. If i read out an object with Get-bConnectApplication.ps1, those white spaces are read in a clean way as it should be.
However, if i try to import a ConsistencyChecks field with CR, LF or any other special chars, they are not interpreted at all.
Please check the code in the JSON implementation and tell us, if there is bug.
And how to submit such characters the right way true bConnect.
BR, Nick
Hi Friedrich,
Could you please add the following line to the file bConnect.psd1: 'Get-bConnectAllOrgUnits',
This is a very simple missing command with big impact on our scripts speed. I could search or translate OUs locally instead of connecting to the Baramundi server for each and every OU ID I need to get info about.
Thanks a lot!
Through an typo in Assert-bConnectConnection ($connectVersion vs $_connectVersion) i recognized that the Stop-PSFunction dosnt't terminate the calling script when the version requirements aren't meet.
I realized that throwing an error inside the try/catch would trigger the Catch Block what wasn't supposed, so i moved the If block below the try/catch block
Although even outside the try/catch block Stop-PSFunction dosn't throw an terminating error, but throw does.
Dosn't work:
Stop-PSFFunction -Message "bConnect has not the Required Version: $MinVersion" -EnableException $true -Cmdlet $PSCmdlet
Works:
Throw "bConnect has not the Required Version: $MinVersion"
Stop-PSFFunction seems to be only working when $ErrorActionPreference is "Stop", while Throw is also terminating with the Default Value "Continue"
We try to update objects with the Edit-bConnect... functions.
It looks like they do not work at all.
We tested Edit-bConnectApplication.ps1 + Edit-bConnectEndpoint.ps1
One can edit the properties, according to the reference and everything looks good on the PS-side, but those changes are never really written to the BMS.
E.g. Application:Comment or Endpoint:DisplayName
If i try the same with a handmade XML-body and a direct Invoke-RestMethod call, it works as expected.
Hi Developers,
there is a wrong parameter in the function "New-bConnectApplication" called "ParentGuid".
That leads to behaviour, that the objects are always written to the root of "Applications".
This parameter must be called "ParentId", according to the baramundi Connect Reference on page 75.
And i could proof it. As soon as i change it to "ParentId" in the PS1 file, the function starts to work as it should.
BR, Nick
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.