From 61fa0898b9a723c15ff61a016b1ee95c7a5590a1 Mon Sep 17 00:00:00 2001 From: taku <23640508+taku-nm@users.noreply.github.com> Date: Mon, 19 Jan 2026 11:34:54 +0100 Subject: [PATCH 1/2] Add Note regarding Scriptblock behaviour exception As per https://github.com/PowerShell/PowerShell/issues/4218 The documentation should outline exceptions in a CMDlet's behaviour. --- reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md index a8cbb2aeb0a9..2dcae64f0391 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -48,6 +48,9 @@ The **TypeNames** property contains the original type name prefixed with `Deseri `Import-Clixml` uses the byte-order-mark (BOM) to detect the encoding format of the file. If the file has no BOM, it assumes the encoding is UTF8. +> [!NOTE] +>**Scriptblocks** are always deserialized to **strings** due to security concerns regarding automatic code execution. + For more information about CLI, see [Language independence](/dotnet/standard/language-independence). From 0f386e0cbe289dbbaed90e50e3a7457a11c370aa Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 20 Jan 2026 14:49:28 -0600 Subject: [PATCH 2/2] Editorial change and copy changes across versions --- reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md | 6 +++++- reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md | 6 +++++- reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md | 5 +++-- reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md | 6 +++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md index 722c403484bd..6a8c3d546976 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/31/2024 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-clixml?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-Clixml @@ -48,6 +48,10 @@ The **TypeNames** property contains the original type name prefixed with `Deseri `Import-Clixml` uses the byte-order-mark (BOM) to detect the encoding format of the file. If the file has no BOM, it assumes the encoding is UTF8. +> [!NOTE] +> `[System.Management.Automation.ScriptBlock]` objects are serialized into the `` element in +> CLIXML. However, the `` element is always deserialized to **Strings**. + For more information about CLI, see [Language independence](/dotnet/standard/language-independence). diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md index bac85f0cede5..27e453b057be 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/31/2024 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-clixml?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-Clixml @@ -48,6 +48,10 @@ The **TypeNames** property contains the original type name prefixed with `Deseri `Import-Clixml` uses the byte-order-mark (BOM) to detect the encoding format of the file. If the file has no BOM, it assumes the encoding is UTF8. +> [!NOTE] +> `[System.Management.Automation.ScriptBlock]` objects are serialized into the `` element in +> CLIXML. However, the `` element is always deserialized to **Strings**. + For more information about CLI, see [Language independence](/dotnet/standard/language-independence). diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md index 2dcae64f0391..73260a2ab3e2 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/31/2024 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-clixml?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-Clixml @@ -49,7 +49,8 @@ The **TypeNames** property contains the original type name prefixed with `Deseri file has no BOM, it assumes the encoding is UTF8. > [!NOTE] ->**Scriptblocks** are always deserialized to **strings** due to security concerns regarding automatic code execution. +> `[System.Management.Automation.ScriptBlock]` objects are serialized into the `` element in +> CLIXML. However, the `` element is always deserialized to **Strings**. For more information about CLI, see [Language independence](/dotnet/standard/language-independence). diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md index 9fbb5e89fd00..4cf7b7eb5c76 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/31/2024 +ms.date: 01/20/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-clixml?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-Clixml @@ -48,6 +48,10 @@ The **TypeNames** property contains the original type name prefixed with `Deseri `Import-Clixml` uses the byte-order-mark (BOM) to detect the encoding format of the file. If the file has no BOM, it assumes the encoding is UTF8. +> [!NOTE] +> `[System.Management.Automation.ScriptBlock]` objects are serialized into the `` element in +> CLIXML. However, the `` element is always deserialized to **Strings**. + For more information about CLI, see [Language independence](/dotnet/standard/language-independence).