Title: Export-FormatData only exports first view · Issue #11825 · PowerShell/PowerShell · GitHub
Open Graph Title: Export-FormatData only exports first view · Issue #11825 · PowerShell/PowerShell
X Title: Export-FormatData only exports first view · Issue #11825 · PowerShell/PowerShell
Description: Export-FormatData only exports first view if the InstanceId is set to a blank guid. I am manually creating ExtendedTypeDefinition objects in order to export to *.format.ps1xml. I was able to workaround the issue by exporting the object t...
Open Graph Description: Export-FormatData only exports first view if the InstanceId is set to a blank guid. I am manually creating ExtendedTypeDefinition objects in order to export to *.format.ps1xml. I was able to workar...
X Description: Export-FormatData only exports first view if the InstanceId is set to a blank guid. I am manually creating ExtendedTypeDefinition objects in order to export to *.format.ps1xml. I was able to workar...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/11825
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Export-FormatData only exports first view","articleBody":"`Export-FormatData` only exports first view if the `InstanceId` is set to a blank `guid`. I am manually creating `ExtendedTypeDefinition` objects in order to export to `*.format.ps1xml`. I was able to workaround the issue by exporting the object to clixml and set a random `guid` and it exported successfully.\r\n\r\n\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\nDescribe 'Export-FormatData' {\r\n It 'Should be able to export multiple views' {\r\n $listControl = [System.Management.Automation.ListControl]::Create().StartEntry().AddItemProperty('test').AddItemProperty('test2').EndEntry().EndList()\r\n $tableControl = [System.Management.Automation.TableControl]::Create().StartRowDefinition().AddPropertyColumn('test').AddPropertyColumn('test2').EndRowDefinition().EndTable()\r\n\r\n $listView = [System.Management.Automation.FormatViewDefinition]::new('Default', $listControl)\r\n $tableView = [System.Management.Automation.FormatViewDefinition]::new('Default', $tableControl)\r\n\r\n $list = New-Object System.Collections.Generic.List[System.Management.Automation.FormatViewDefinition]\r\n $list.Add($listView)\r\n $list.Add($tableView)\r\n\r\n $typeDef = [System.Management.Automation.ExtendedTypeDefinition]::new('TestTypeName', $list)\r\n $typeDef | Export-FormatData -Path C:\\temp\\test.format.ps1xml\r\n [xml]$xml = Get-Content C:\\temp\\test.format.ps1xml\r\n @($xml.Configuration.ViewDefinitions.View).Count | Should -BeGreaterThan 1\r\n }\r\n}\r\n```\r\n\r\n# Expected behavior\r\n\r\nTest should pass\r\n\r\n# Actual behavior\r\n\r\n```none\r\nDescribing Export-FormatData\r\n [-] Should be able to export multiple views 29ms\r\n at \u003cScriptBlock>, C:\\Temp\\format.tests.ps1: line 16\r\n 16: @($xml.Configuration.ViewDefinitions.View).Count | Should -BeGreaterThan 1\r\n Expected the actual value to be greater than 1, but got 1.\r\n```\r\n\r\n# Environment data\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 7.0.0-rc.2\r\nPSEdition Core\r\nGitCommitId 7.0.0-rc.2\r\nOS Microsoft Windows 10.0.18363\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/ThomasNieto","@type":"Person","name":"ThomasNieto"},"datePublished":"2020-02-11T01:55:26Z","url":"https://github.com/PowerShell/PowerShell/issues/11825"}
| 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:d8286b58-2deb-d7c6-5ccc-c63ce1a51054 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A154:10CBA:20DF82:2C515B:6AFD44F3 |
| html-safe-nonce | c7205415115851087da2d5aac2d4f4243942b11b711f083e0d4c8369c0cac23d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTU0OjEwQ0JBOjIwREY4MjoyQzUxNUI6NkFGRDQ0RjMiLCJ2aXNpdG9yX2lkIjoiNzU0NTczNjQ2MjU0OTczMDU0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9b05e4489559ad080fab9a6b3da704eb213874d7e1e0a85dc8dca45257dcb306 |
| hovercard-subject-tag | issue:562932576 |
| 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/11825/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f5db6611ac2c3968a9211dd3fc81c0fe5192bf466588d9bcc187913c9925133/PowerShell/PowerShell/issues/11825 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f5db6611ac2c3968a9211dd3fc81c0fe5192bf466588d9bcc187913c9925133/PowerShell/PowerShell/issues/11825 |
| og:image:alt | Export-FormatData only exports first view if the InstanceId is set to a blank guid. I am manually creating ExtendedTypeDefinition objects in order to export to *.format.ps1xml. I was able to workar... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ThomasNieto |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| 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 | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width