Title: Question: not getting expected results for get-formatdata · Issue #9300 · PowerShell/PowerShell · GitHub
Open Graph Title: Question: not getting expected results for get-formatdata · Issue #9300 · PowerShell/PowerShell
X Title: Question: not getting expected results for get-formatdata · Issue #9300 · PowerShell/PowerShell
Description: This is a followup to issue #8063 which appears closed but which did not fix the originally reported problem. Steps to reproduce Hi Steve, I have been anxiously awaiting this fix to test out the issues we discussed last year. Unfortunate...
Open Graph Description: This is a followup to issue #8063 which appears closed but which did not fix the originally reported problem. Steps to reproduce Hi Steve, I have been anxiously awaiting this fix to test out the is...
X Description: This is a followup to issue #8063 which appears closed but which did not fix the originally reported problem. Steps to reproduce Hi Steve, I have been anxiously awaiting this fix to test out the is...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/9300
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Question: not getting expected results for get-formatdata","articleBody":"This is a followup to issue #8063 which appears closed but which did not fix the originally reported problem.\r\n\r\n# Steps to reproduce\r\n\r\nHi Steve,\r\n\r\nI have been anxiously awaiting this fix to test out the issues we discussed last year.\r\n\r\nUnfortunately the problems do not appear to be fixed and things appear to be seriously broken still to the point that the results are unusable.\r\n\r\nRun these commands\r\n\r\npwsh -noprofile\r\nGet-FormatData -PowerShellVersion 6.2 -TypeName System.IO.DirectoryInfo | Export-FormatData -LiteralPath DirectoryInfo.ps1xml\r\nGet-FormatData -PowerShellVersion 6.2 -TypeName System.IO.FileInfo | Export-FormatData -LiteralPath FileInfo.ps1xml\r\nIf you compare DirectoryInfo.ps1xml and FileInfo.ps1xml you will find the are exactly the same, however, the output for a directory item versus a file item should not be the same as a directory does not contain a length.\r\n\r\nIgnoring that issue, the results returned are missing lots of XML code that was previously in FileSystem.format.ps1xml.\r\n\r\nI won't detail them all here as you can compare the results produced of Get-FormatData with the old FileSystem.format.ps1xml file to see them all, however, I will point out a few.\r\n\r\nFileSystem.format.ps1xml created a SelectionSet named FileSystemTypes and then used that and a CustomControlName FileSystemTypes-GroupingFormat for the view definitions. Those are all missing from the \"Get-FormatData\" results for System.IO.DirectoryInfo / System.IO.FileInfo.\r\n\r\nIgnore those issues, I attempted to merge my changes into the results returned from Get-FormatData and I found that my changes were not displaying so I did this simple test.\r\n\r\npwsh -noprofile\r\nGet-FormatData -PowerShellVersion 6.2 -TypeName System.IO.DirectoryInfo | Export-FormatData -LiteralPath DirectoryInfo.ps1xml\r\n\r\nEdit the DirectoryInfo.ps1xml file and make the following change:\r\n\r\n Look for \u003cLabel>LastWriteTime\u003c/Label> and change it to \u003cLabel>XXXXWriteTime\u003c/Label>\r\n\r\nNow run\r\n\r\n Update-FormatData -PrependPath .\\DirectoryInfo.ps1xml\r\n\r\nNow run Get-ChildItem and you will see that the label still says LastWriteTime instead of XXXXWriteTime\r\n\r\nNow run this to get what the updated formatting info looks like\r\n\r\n Get-FormatData -PowerShellVersion 6.2 -TypeName System.IO.DirectoryInfo | Export-FormatData -LiteralPath DirectoryInfo2.ps1xml\r\n\r\nYou will find that it does show the change, however. there is another section after it that still has the label as \"LastWriteTime\".\r\nI believe all of these issues are because Get-FormatData is not returning the full and correct format data for these types.\r\n\r\nIf I run \"Update-FormatData -Prepend My,FileSystem.format.ps1\" which uses the modified version of the old FileSystem.format.ps1xml file that used to be included in PowerShell, then everything works correctly and it has my changes.\r\n\r\nSo we are back to the original problem.\r\n\r\nThere needs to be a way for me to obtain the format data being used (either via a file like it previously did or with Get-FormatData returning the correct formatting that is really being used).\r\n\r\nSince PowerShell is no longer including the *.format.ps1xml files and Get-FormatData is broken and does not return the correct format data I have no way to determine what changes were made in new versions of PowerShell so that I can integrate them into my modified version.\r\n\r\nI hope that this can be made a priority and get fixed soon.\r\n\r\nHoller if you want any more details.\r\n\r\nThanks!\r\n\r\nJoe\r\n","author":{"url":"https://github.com/JoeSalmeri","@type":"Person","name":"JoeSalmeri"},"datePublished":"2019-04-05T19:32:49Z","url":"https://github.com/PowerShell/PowerShell/issues/9300"}
| 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:6b060e82-4757-f378-1c91-b97e943a2de4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB76:5453:1D2C6D:2993BA:6AFD51CA |
| html-safe-nonce | 28fb9b55c547ade15109cf84a9d4e07d01898ec56dfc09c36ec7d347c5d0e44e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjc2OjU0NTM6MUQyQzZEOjI5OTNCQTo2QUZENTFDQSIsInZpc2l0b3JfaWQiOiIzNzc3MTk3NDU4Mjc0OTk2NjgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3c1d3f03fd7f68c89a0f455a52a6bf0efd291dd9e6035fef5825c5077e9b5882 |
| hovercard-subject-tag | issue:429904072 |
| 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/9300/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5b0ea9a35344e09cbd423919435f6a5c646b23fdce6d5d2dbc4f90f99200a94b/PowerShell/PowerShell/issues/9300 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5b0ea9a35344e09cbd423919435f6a5c646b23fdce6d5d2dbc4f90f99200a94b/PowerShell/PowerShell/issues/9300 |
| og:image:alt | This is a followup to issue #8063 which appears closed but which did not fix the originally reported problem. Steps to reproduce Hi Steve, I have been anxiously awaiting this fix to test out the is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JoeSalmeri |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| 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 | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width