Title: Scriptblocks serialized to Clixml are deserialized as strings · Issue #4218 · PowerShell/PowerShell · GitHub
Open Graph Title: Scriptblocks serialized to Clixml are deserialized as strings · Issue #4218 · PowerShell/PowerShell
X Title: Scriptblocks serialized to Clixml are deserialized as strings · Issue #4218 · PowerShell/PowerShell
Description: ScriptBlock objects are deserialized as strings when run through Import-CliXml. Roman Kuzmin 1967-2026 (@nightroman) has a more detailed test case on his PowerShellTraps repo, including a link to a Microsoft Connect issue from March of 2...
Open Graph Description: ScriptBlock objects are deserialized as strings when run through Import-CliXml. Roman Kuzmin 1967-2026 (@nightroman) has a more detailed test case on his PowerShellTraps repo, including a link to a...
X Description: ScriptBlock objects are deserialized as strings when run through Import-CliXml. Roman Kuzmin 1967-2026 (@nightroman) has a more detailed test case on his PowerShellTraps repo, including a link to a...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4218
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Scriptblocks serialized to Clixml are deserialized as strings","articleBody":"\u003c!--\r\n\r\nIf it is a bug report:\r\n- make sure you are able to repro it on the latest released version. \r\nYou can install the latest version from https://github.com/PowerShell/PowerShell/releases\r\n- Search the existing issues.\r\n- Refer to the [FAQ](../docs/FAQ.md).\r\n- Refer to the [known issues](../docs/KNOWNISSUES.md).\r\n- Fill out the following repro template\r\n\r\nIf it's not a bug, please remove the template and elaborate the issue in your own words.\r\n-->\r\n\r\nScriptBlock objects are deserialized as strings when run through Import-CliXml.\r\n\r\n@nightroman has [a more detailed test case](https://github.com/nightroman/PowerShellTraps/tree/master/Clixml/ScriptBlock-becomes-String) on his PowerShellTraps repo, including a link to [a Microsoft Connect issue](https://connect.microsoft.com/PowerShell/feedback/details/1202386) from March of 2015. This appears to have been [migrated](https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11088468-clixml-system-management-automation-psserialize) to the Windows Server UserVoice, but the issue still exists in v6.0.0-beta.3.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\n\r\n{Get-Process} | Export-Clixml .\\Test.clixml\r\n\r\nImport-Clixml .\\Test.Clixml | % GetType\r\n\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\n\r\nIsPublic IsSerial Name BaseType\r\n-------- -------- ---- --------\r\nTrue True ScriptBlock System.Object\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\n\r\nIsPublic IsSerial Name BaseType\r\n-------- -------- ---- --------\r\nTrue True String System.Object\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```powershell\r\n> $PSVersionTable\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-beta\r\nPSEdition Core\r\nGitCommitId v6.0.0-beta.3\r\nOS Microsoft Windows 10.0.15063\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/hmmwhatsthisdo","@type":"Person","name":"hmmwhatsthisdo"},"datePublished":"2017-07-11T02:53:47Z","url":"https://github.com/PowerShell/PowerShell/issues/4218"}
| 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:04d66aba-fe5b-4a30-d8ae-e2dbf874acad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C07C:3B38CF:28386AA:38258F8:6AFD4FFE |
| html-safe-nonce | dc53de1982972063949bc5a1d36f19bd32200dbdd29c9b3fbea069d4a9e7c199 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDdDOjNCMzhDRjoyODM4NkFBOjM4MjU4Rjg6NkFGRDRGRkUiLCJ2aXNpdG9yX2lkIjoiMzcwNjMwNzQyOTYyMTY0OTQwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bba0a0c114161d99d48e76896ae7e2fecbba870045ec51eea0f93deed10074eb |
| hovercard-subject-tag | issue:241909455 |
| 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/4218/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0c1a871a45dcc2005bc6154adc7884a2df9c145715458448102e55a258e2760d/PowerShell/PowerShell/issues/4218 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0c1a871a45dcc2005bc6154adc7884a2df9c145715458448102e55a258e2760d/PowerShell/PowerShell/issues/4218 |
| og:image:alt | ScriptBlock objects are deserialized as strings when run through Import-CliXml. Roman Kuzmin 1967-2026 (@nightroman) has a more detailed test case on his PowerShellTraps repo, including a link to a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hmmwhatsthisdo |
| 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