$AppInfoRaw = Get-BCContainerAppInfo -containerName MyContainer -tenantSpecificProperties $trueTo see the content of the object just select the object in your editor and hit F8. Try with and without the tenantSpecificProperties switch, that is what gets the sync state and installation status of the app.
$AppInfoRaw = Get-BCContainerAppInfo -containerName MyContainer -tenantSpecificProperties $true $MyObjectList = @() foreach($AppInfo in $AppInfoRaw) { $obj = New-Object psobject -Property @{ ItsName = $AppInfo.Name ItsPublisher = $AppInfo.Publisher ItsInstalled = $AppInfo.IsInstalled ItsPublished = $AppInfo.IsPublished ItsSyncState = $AppInfo.SyncState } $MyObjectList += $obj } $MyObjectList | Format-TableThis gives the following output:
Answers
[xml]$xmlFile = Get-NAVAppInfo -Name 'MyApp' -ServerInstance 'BC140' | ConvertTo-Xml
$SelectedNode = [xml]$xmlFile | Select-XML -XPath "//Property[@Name='Version']" | Select-Object -ExpandProperty "node"
$TheVersion = $SelectedNode.InnerText
Not sure if Get-NAVAppInfo loads the app information directly but you'd have to play around with it to make that happen
RIS Plus, LLC
So please provide a working solution for Get-NAVAppInfo result processing this way.
I know how to convert a json file to powershell object, but using it this way
could make you end up with a complex type json.. that's what I remember encountering
trying to tackle this problem. So I choose the xml option as the best way to go.
RIS Plus, LLC
Just hoped you could show us the playing around part. At least that would have contributed something.
I posted that for Jimmy, not you. I know you already know everything
RIS Plus, LLC
You actually don't need a Json object. You can just read the output into a psobject and browse through them
RIS Plus, LLC
As it was last time.
Good one! Spared Jimmy a lot of json hussle.
And you're welcome by the way, I know you meant to say thank you because you are such a nice guy
RIS Plus, LLC
RIS Plus, LLC
You can load the output of a Cmdlet into a PSObject like this: To see the content of the object just select the object in your editor and hit F8. Try with and without the tenantSpecificProperties switch, that is what gets the sync state and installation status of the app.
From this point on, you can access the object members straight from the editor. All you have to do is load it once, and then intellisense will show you the members, even its sub-members:
Here's an example of how to read the app information from MyContainer into an object, loop through the object and display the content in a list: This gives the following output:
This is not all of it, because there are many more apps, but that's the content of the object
I'm going to write a blog post about this with more details, but I thought you'd be interested in seeing this right away. Let me know if this is what you were looking for
RIS Plus, LLC