Snow-Shell / servicenow-powershell

PowerShell module to automate ServiceNow service and asset management. This module can be used standalone, with Azure Automation, or Docker.
Apache License 2.0
359 stars 170 forks source link

Expanding the CustomVariable #205

Closed gdbarron closed 1 year ago

gdbarron commented 1 year ago

Discussed in https://github.com/Snow-Shell/servicenow-powershell/discussions/204

Originally posted by **DrMarkX** September 22, 2022 I like the new IncludeCustomVariable format. This makes it easier to display the minute data within that variable. However, I used to be able to see all the details of the CustomVariable by using this one-liner. `Get-ServiceNowRecord RITM888888 -IncludeCustomVariable | Select-Object CustomVariable -ExpandProperty CustomVariable` That no longer expands all parts. Is there another way to get these data? Old way shows data like this. ``` Name : something_check Value : false DispalayName : Do you need this thing? Type : CheckBox ``` New Way shows data like this. `something_chcck : {Type, DisplayName, Value}`
gdbarron commented 1 year ago

@drmarkx, thanks for the heads up. I left off a conversion to pscustomobject and was returning a hashtable instead. Would you mind manually updating and see if this is what you're looking for? https://github.com/Snow-Shell/servicenow-powershell/commit/1c8fe5850943c424657356201d050e1ea41651d3

DrMarkX commented 1 year ago

Tested. That fixed the issue. Thanks!