Title: Add Amended Parameter to Get-CimClass · Issue #15378 · PowerShell/PowerShell · GitHub
Open Graph Title: Add Amended Parameter to Get-CimClass · Issue #15378 · PowerShell/PowerShell
X Title: Add Amended Parameter to Get-CimClass · Issue #15378 · PowerShell/PowerShell
Description: Every time we query a CIM Instance we get Datafileds which are Numeric. With this Numeric Values the datafields are not Human friendly and therefore needles in many cases. (eg. Asset Inventory databases) A Human has to translate a Status...
Open Graph Description: Every time we query a CIM Instance we get Datafileds which are Numeric. With this Numeric Values the datafields are not Human friendly and therefore needles in many cases. (eg. Asset Inventory data...
X Description: Every time we query a CIM Instance we get Datafileds which are Numeric. With this Numeric Values the datafields are not Human friendly and therefore needles in many cases. (eg. Asset Inventory data...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/15378
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add Amended Parameter to Get-CimClass","articleBody":"Every time we query a CIM Instance we get Datafileds which are Numeric.\r\nWith this Numeric Values the datafields are not Human friendly and therefore needles in many cases. (eg. Asset Inventory databases)\r\nA Human has to translate a Status Information by Hand every time.\r\n\r\nThese Numeric Values can be automatically translated into a Human friendly Text with the help of the amended (verbose) informations in a CimClass for each Property and the Qualifiers ValueMap to Values and BitMap To BitValues. \r\n\r\nFor that purpose Get-WmiObject had the -Amended Parameter.\r\n\r\nGet-CimClass is lacking this parameter and therefore we can not get Amended Informations (on windows Systems that are not installed in en-US environment).\r\n\r\nI followed the [#PStip on PowerShellMagazin ](https://powershellmagazine.com/2014/04/23/pstip-mapping-the-cim-valuemap-and-value-qualifiers/) and this did not worked for me because there is simply no amended Data in a CimClass on my System with German de-DE setup. Does this works on Systems with en-US Setup?\r\n\r\nOnly if I call CimSession.GetClass() with the CimOperationOptions Flag LocalizedQualifiers\r\nI get a CimClass with amended Data in en-US language or de-DE. Depending on my choice.\r\n\r\nCurrently I pull amended CimClasses with Get-WmiObject or with the help of a CimSession like so:\r\n```powershell\r\nFunction Get-CimClassAmended {\r\n\r\n [CmdletBinding()]\r\n param(\r\n [String[]]$Classname,\r\n\r\n [String]$NameSpace = 'root\\cimv2',\r\n\r\n [System.Globalization.CultureInfo]$Culture = [System.Globalization.CultureInfo]'en-US'\r\n )\r\n\r\n begin {\r\n\r\n $AmendedDcomCIMSessionOption = New-CimSessionOption -Protocol 'Dcom' -UICulture $Culture -Culture $Culture\r\n $AmendedDcomCIMSessionOption.Impersonation = [Microsoft.Management.Infrastructure.Options.ImpersonationType]::Impersonate\r\n\r\n\r\n\r\n $AmendedDcomCimSession = New-CimSession -SessionOption $AmendedDcomCIMSessionOption\r\n\r\n\r\n\r\n $AmendedDcomCimOperationSessionOptions = New-Object -TypeName 'Microsoft.Management.Infrastructure.Options.CimOperationOptions'\r\n $AmendedDcomCimOperationSessionOptions.Flags = [Microsoft.Management.Infrastructure.Options.CimOperationFlags]::LocalizedQualifiers\r\n\r\n }\r\n\r\n process {\r\n\r\n ForEach ($ClassN in $Classname) {\r\n Try {\r\n # return the CIM class with amended (verbose) informations\r\n Write-Output $AmendedDcomCimSession.GetClass($Namespace, $ClassN, $AmendedDcomCimOperationSessionOptions)\r\n }\r\n Catch {\r\n Write-Error -ErrorRecord $_\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nI only have skills with PowerShell and I am not a .NET developer.\r\nSo please Add -Amended Parameter to Get-CimClass\r\n seems very easy.....\r\n","author":{"url":"https://github.com/Kriegel","@type":"Person","name":"Kriegel"},"datePublished":"2021-05-11T16:02:57Z","url":"https://github.com/PowerShell/PowerShell/issues/15378"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f7a07b54-1906-e72b-39da-81a752f7debd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9360:38E576:68ACC9:9784A9:6AFD8FA2 |
| html-safe-nonce | 1d492f2f6c59a2033a73a97797b0f0610b97a6e00a0cd5bc5d7f1c8260112da5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzYwOjM4RTU3Njo2OEFDQzk6OTc4NEE5OjZBRkQ4RkEyIiwidmlzaXRvcl9pZCI6IjEyNTU1MzQ1MTU2OTA3NzAzMzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3e84cef98ac03d077973f6c5b1a585b0263ba7fec05a59d4214f6342171e6bf7 |
| hovercard-subject-tag | issue:887735912 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/15378/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0b30a264fb30ebcba4aaab0266bec510083e6b2fe89b968d8c8210d99f04c3db/PowerShell/PowerShell/issues/15378 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0b30a264fb30ebcba4aaab0266bec510083e6b2fe89b968d8c8210d99f04c3db/PowerShell/PowerShell/issues/15378 |
| og:image:alt | Every time we query a CIM Instance we get Datafileds which are Numeric. With this Numeric Values the datafields are not Human friendly and therefore needles in many cases. (eg. Asset Inventory data... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Kriegel |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width